Skip to content

[18.0][MIG] stock_partner_delivery_window: Migration to 18.0#1

Closed
thienvh332 wants to merge 36 commits into18.0from
18.0-mig-stock_partner_delivery_window
Closed

[18.0][MIG] stock_partner_delivery_window: Migration to 18.0#1
thienvh332 wants to merge 36 commits into18.0from
18.0-mig-stock_partner_delivery_window

Conversation

@thienvh332
Copy link
Owner

No description provided.

grindtildeath and others added 30 commits November 27, 2024 10:40
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.
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/
weblate and others added 5 commits November 27, 2024 10:40
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/
Copy link

@xaviedoanhduy xaviedoanhduy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a small remark,
but LGTM

partner_id = fields.Many2one(
"res.partner", required=True, index=True, ondelete="cascade"
)
tz = fields.Selection(related="partner_id.tz", readonly=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tz = fields.Selection(related="partner_id.tz", readonly=True)
tz = fields.Selection(related="partner_id.tz")

By default, related fields are:

not stored

not copied

readonly

computed in superuser mode

formatted_scheduled_date = format_datetime(self.env, scheduled_date)
partner = self.partner_id
if partner.delivery_time_preference == "workdays":
message = _(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can replace the call to translate a string () with self.env. for getting some performance improvement in some cases. See odoo/odoo#174844.

please also get rid of the .format, see OCA/odoo-module-migrator#114
(here and in other locations; also impact translations)

@thienvh332 thienvh332 force-pushed the 18.0-mig-stock_partner_delivery_window branch from f51baa7 to ba0b1b4 Compare November 28, 2024 11:20
@thienvh332 thienvh332 closed this Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.