[17.0] [MIG] sale_auto_remove_zero_quantity_lines: Migration to 17.0#3883
[17.0] [MIG] sale_auto_remove_zero_quantity_lines: Migration to 17.0#3883bizzappdev wants to merge 14 commits intoOCA:17.0from
Conversation
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-workflow-16.0/sale-workflow-16.0-sale_auto_remove_zero_quantity_lines Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_auto_remove_zero_quantity_lines/
…have a product_id
… hook to make customization easier
Currently translated at 100.0% (7 of 7 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_auto_remove_zero_quantity_lines Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_auto_remove_zero_quantity_lines/de/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-workflow-16.0/sale-workflow-16.0-sale_auto_remove_zero_quantity_lines Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_auto_remove_zero_quantity_lines/
Currently translated at 100.0% (7 of 7 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_auto_remove_zero_quantity_lines Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_auto_remove_zero_quantity_lines/it/
Currently translated at 100.0% (7 of 7 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_auto_remove_zero_quantity_lines Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_auto_remove_zero_quantity_lines/hr/
|
/ocabot migration sale_auto_remove_zero_quantity_lines |
aa6bbac to
e46c7bc
Compare
alexey-pelykh
left a comment
There was a problem hiding this comment.
Reviewed the migration from 16.0 to 17.0. Overall this is a clean migration with one good improvement (batch unlink outside the loop). CI is green and the module structure follows OCA conventions correctly.
A couple of minor observations:
-
i18n
.potfile version: TheProject-Id-Versionin.potand.pofiles still referencesOdoo Server 16.0. These should ideally be regenerated for 17.0, but Weblate typically handles this automatically upon merge, so this is non-blocking. -
Potential
AttributeErroronline.name.strip(): In the lambda filter, ifline.nameisFalse(which is the default forfields.Text), calling.strip()on it would raiseAttributeError. This could be guarded withnot (line.name or "").strip(). That said, this code is carried over from 16.0 and works in practice becauseline_notelines tend to always have a string value, so this is also non-blocking.
Nothing blocking here -- the migration looks correct.
| if order._should_auto_remove_zero_quantity_lines(): | ||
| zero_or_empty_lines = order.order_line.filtered( | ||
| lambda line: (line.product_id and line.product_uom_qty == 0) | ||
| or (line.display_type == "line_note" and not line.name.strip()) |
There was a problem hiding this comment.
Minor/defensive: If line.name is ever False (the default for fields.Text), calling .strip() on it would raise AttributeError. A safer pattern would be:
or (line.display_type == "line_note" and not (line.name or "").strip())This is inherited from 16.0 and works in practice (note lines typically have a string), so non-blocking.
lmignon
left a comment
There was a problem hiding this comment.
Thank you for the migration. LGTM
No description provided.