[18.0][MIG] sale_order_safe_commitment_date: Migration to 18.0#4086
Open
chienandalu wants to merge 5 commits into
Open
[18.0][MIG] sale_order_safe_commitment_date: Migration to 18.0#4086chienandalu wants to merge 5 commits into
chienandalu wants to merge 5 commits into
Conversation
chienandalu
force-pushed
the
18.0-mig-sale_order_safe_commitment_date
branch
from
January 2, 2026 09:19
cb3cd7b to
db19253
Compare
Contributor
|
/ocabot migration sale_order_safe_commitment_date |
Contributor
|
@chienandalu Could you check tests ? |
Users who set the delivery date expect it to be present in order to be able to filter by it. MT-9790
The delivery date is computed by default from the expected date. We can still edit it, but if can't be delivered, it will be force on confirmation. MT-9790
When the lead time has decimals (for example, 1.5 = 36 hours) a lot of false positives are raised for the delivery exceptions. as the default hour for the delivery date is the current one. For example: in that case if the current hour is 01:00, the expected date will be 13:00 for the next day, but when we set the delivery date for tomorrow, the default hour will be tomorrow at 1:00, which is before that expected day. The users tend to ignore the warnings after stumbling upon these cases over and over. So now: - There's a new delivery date helper field to simply set the date (no time) that sets the hour to 23.59.59 for the delivery date (commitment_date) - The delivery date can be still changed manually whenever that info is important as usal in the standard. MT-9790
chienandalu
force-pushed
the
18.0-mig-sale_order_safe_commitment_date
branch
4 times, most recently
from
February 3, 2026 10:58
e4c0872 to
5fccf9e
Compare
chienandalu
force-pushed
the
18.0-mig-sale_order_safe_commitment_date
branch
from
February 3, 2026 12:22
5fccf9e to
549f93d
Compare
alexey-pelykh
approved these changes
Feb 28, 2026
alexey-pelykh
left a comment
There was a problem hiding this comment.
Nice module! The cut-off calendar approach using resource.calendar is smart — it leverages existing Odoo infrastructure rather than reinventing scheduling logic.
The _inverse_date_for_commitment setting time to 00:00 of the day in user TZ and converting to UTC is the correct pattern for date-to-datetime fields. Tests with freezegun properly validate the cut-off scenarios.
Code review LGTM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://www.loom.com/share/3f582ee0d01b4130ad0d61db275b254f
cc @moduon MT-12188