-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][ADD] stock_release_channel_process_end_time #550
Conversation
a1f6668
to
e6b24b9
Compare
|
||
_inherit = "stock.release.channel" | ||
|
||
process_end_date = fields.Datetime( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rousseldenis A release channel instance is not created every day. A release channel is a way to organize your pick to deliver process into your company. It's therefore useless to specify the date and time when the process of pickings should be completed. IMO, this process_end_date should be replaced by a process_end_time...
@jbaudoux What do you thing about?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rousseldenis A release channel instance is not created every day. A release channel is a way to organize your pick to deliver process into your company. It's therefore useless to specify the date and time when the process of pickings should be completed. IMO, this process_end_date should be replaced by a process_end_time...
@lmignon Ok, didn't catch that.
The only drawback I see is that is not flexible (but maybe it's wanted - I don't have the whole flow in mind) as one may want to have channel opened during the day, but pickings done during the night (so, overlap between two days)
e6b24b9
to
839f5ea
Compare
62efcc7
to
68d5262
Compare
test-requirements.txt
Outdated
@@ -0,0 +1,2 @@ | |||
odoo-addon-stock-release-channel @ git+https://github.com/OCA/wms.git@refs/pull/506/head#subdirectory=setup/stock_release_channel | |||
odoo-addon-stock-available-promise-release @ git+https://github.com/OCA/wms.git@refs/pull/478/head#subdirectory=setup/stock_available_promise_release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
odoo-addon-stock-available-promise-release @ git+https://github.com/OCA/wms.git@refs/pull/478/head#subdirectory=setup/stock_available_promise_release | |
odoo-addon-stock-available-to-promise-release @ git+https://github.com/OCA/wms.git@refs/pull/478/head#subdirectory=setup/stock_available_to_promise_release |
68d5262
to
ca9239c
Compare
@lmignon This one is ready |
@api.model | ||
def assign_release_channel(self, picking): | ||
res = super().assign_release_channel(picking) | ||
# Check if a channel has been assigned to the picking and write scheduled_date |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rousseldenis For my information, are you sure that a write is triggered if we assign the same value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Checked.
We pass always in that line:
https://github.com/odoo/odoo/blob/16.0/odoo/fields.py#L1320
In fact, I think this is done at purpose to avoid maybe a unneeded read if field value is not in the cache (to be able to compare) and to be able to update the write_uid/write_date as in fact, people try to update the record even if value is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little change required but work as expected
f17df21
to
c29d5a6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (Code review, functional tests)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rousseldenis The process_end_date
field is not taken into account into the computation of domains used to retrieve pickings to release | late | done
As consequence, if the process_end_date is computed to tomorrow, the pickings assigned to the channel will not be taken visible since the scheduled_date will be set at tomorrow and the date criteria into the domains is set to today... (see https://github.com/OCA/wms/pull/493/files#diff-a8bb5a8dfb388e49242b1d9fe2274b33dccde4e032d0983647f70fa52399ecbcR174)
implemented in 8f20385
@rousseldenis Changes to the process_end_time is not applied to the process_end_date and pickings to process (maybe it's overkill???) |
c29d5a6
to
e7fdfdc
Compare
8042afb
to
8f20385
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some typo in the helps
stock_release_channel_process_end_time/models/stock_release_channel.py
Outdated
Show resolved
Hide resolved
2494ecf
to
310a615
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason behind this new config? In which situation you don't want to plan the work for the given end date?
In my opinion, we should have by default the option active.
If the option is inactive, we should still never have a scheduled date > process end date. So it should still be min(release date + delay, process end date)
stock_release_channel_process_end_time/models/res_config_settings.py
Outdated
Show resolved
Hide resolved
stock_release_channel_process_end_time/models/res_config_settings.py
Outdated
Show resolved
Hide resolved
So the option must remain inactive because it makes the test in |
049175d
to
ac5d844
Compare
@rousseldenis ping (for the build) |
@rousseldenis do you have time to rebase and shorten/cleanup commits? I can do it otherwise |
As time should be timezoned to correctly compute the real end date, consider the channel warehouse timezone or company one. If not defined, consider the timezone as UTC.
… seconds and microseconds
…fined before assignation to scheduled_date
…utation The compute of releasable picking must take into account the process end date of the stock release channel and not the current datetime. The way the ORM is working into Odoo prevent to makes query on model with criteria based on values from linked model (comparing column from model A to column of model B). To work arround this limitation, we use a specialized field with a search method. Field's search methods are considered as 'internal' search methods and therefore allows you to use a special 'inselect' operator. This kind operator is usefull since it allows to express a criteria as a plain SQL quey. Thanks to this approach we've an easy way to implement our needs with the Odoo's ORM.
…e_tz Co-authored-by: Jacques-Etienne Baudoux <je@bcim.be>
ac5d844
to
11372d0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
/ocabot merge nobump |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at e6396f2. Thanks a lot for contributing to OCA. ❤️ |
Depends on :