-
-
Notifications
You must be signed in to change notification settings - Fork 666
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
[18.0][MIG] stock_partner_delivery_window: Migration to 18.0 #1783
base: 18.0
Are you sure you want to change the base?
[18.0][MIG] stock_partner_delivery_window: Migration to 18.0 #1783
Conversation
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.
seems good
/ocabot migration stock_partner_delivery_window |
This PR has the |
domain = [("partner_id", "in", self.ids)] | ||
if day_name is not None: | ||
week_day_id = self.env["time.weekday"]._get_id_by_name(day_name) | ||
domain.append(("time_window_weekday_ids", "in", week_day_id)) |
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.
append is never a good idea. Using expression.AND()
is better.
} | ||
for window_id in self.delivery_time_window_ids | ||
] | ||
result["delivery_time_window_ids"] = [(0, 0, val) for val in values] |
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.
Minor comment, using Command
is IMHO better.
message = self.env._( | ||
"The scheduled date is {date} ({weekday}), but the partner is " | ||
"set to prefer deliveries on working days." | ||
).format( |
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.
You should use translate function arguments instead.
def _planned_delivery_date(self): | ||
return self.scheduled_date | ||
|
||
@api.onchange("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.
IMHO, warnings could be avoided using alerts instead.
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) |
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.
Use BaseCommon
class to avoid this.
Two small improvements: * add a hook to change the delivery time format * no need to display seconds, hh:mm is enough
…ry_time_preference The default value introduced by workdays feature breaks the installation of Demo databases as the change is not reflected in sale_partner_delivery_window.
… field is related
version conflict prevents upload to pypi
When copying partner, if the partner's delivery time preference is time window, time window ids should be copied as well.
Currently translated at 100.0% (27 of 27 strings) Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_partner_delivery_window Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_partner_delivery_window/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_partner_delivery_window Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_partner_delivery_window/
Currently translated at 100.0% (27 of 27 strings) Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_partner_delivery_window Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_partner_delivery_window/it/
Currently translated at 100.0% (27 of 27 strings) Translation: stock-logistics-workflow-16.0/stock-logistics-workflow-16.0-stock_partner_delivery_window Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-workflow-16-0/stock-logistics-workflow-16-0-stock_partner_delivery_window/it/
ba0b1b4
to
bce6c2f
Compare
No description provided.