Skip to content

[19.0][MIG] sale_product_set: Migration to 19.0#3941

Open
mmrondon wants to merge 83 commits intoOCA:19.0from
archeti-org:19.0-mig-sale_product_set
Open

[19.0][MIG] sale_product_set: Migration to 19.0#3941
mmrondon wants to merge 83 commits intoOCA:19.0from
archeti-org:19.0-mig-sale_product_set

Conversation

@mmrondon
Copy link
Copy Markdown
Contributor

No description provided.

Pierre Verkest and others added 30 commits October 13, 2025 16:05
* when a set is added to a sales order, it passes the unit of measure
of the product to the sales order line. Fixes an incompatibility with
module sale_margin.
…#543)

* [imp] move SO `add set` button to smartbutton header

* [fix] sale_product_set: PEP8
Currently translated at 100.0% (22 of 22 strings)

Translation: sale-workflow-11.0/sale-workflow-11.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-11-0/sale-workflow-11-0-sale_product_set/es/
Co-Authored-By: sbejaoui <souheil_bejaoui@hotmail.fr>
Currently translated at 100.0% (24 of 24 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_product_set/es/
Currently translated at 100.0% (25 of 25 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_product_set/de/
Currently translated at 100.0% (27 of 27 strings)

Translation: sale-workflow-12.0/sale-workflow-12.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-sale_product_set/zh_CN/
Add `partner_id` to product.set allowing to define specific sets per customer
Before this change: try to delete a set used in a wizard right after
-> KABOOM! The FK over the set would prevent deletion
Christopher Rogos and others added 19 commits October 13, 2025 16:05
Translated using Weblate (Italian)

Currently translated at 100.0% (23 of 23 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_product_set/it/

[UPD] Update sale_product_set.pot

[BOT] post-merge updates

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_product_set/

Translated using Weblate (Italian)

Currently translated at 100.0% (26 of 26 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_product_set/it/

Translated using Weblate (Spanish)

Currently translated at 100.0% (26 of 26 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_product_set/es/
… product_set

The reason to move this logic is that there are other modules that extend
product_set as for example stock_product_set but at the same time make use
of the transient model to define a wizard. For this reason it is better to
have the logic available in product_set module and avoid duplicating code or
inheriting from sale_product_set and what this implies in their respective
dependencies with the only need to extend the transient model.
In addition, the transient model is renamed to make it clearer to identify
that it is this type of model.

TT48100

[UPD] Update sale_product_set.pot

[BOT] post-merge updates

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-16.0/sale-workflow-16.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_product_set/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-17.0/sale-workflow-17.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_product_set/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-17.0/sale-workflow-17.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_product_set/
Currently translated at 100.0% (25 of 25 strings)

Translation: sale-workflow-17.0/sale-workflow-17.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_product_set/de/
Currently translated at 100.0% (25 of 25 strings)

Translation: sale-workflow-17.0/sale-workflow-17.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_product_set/sv/
Currently translated at 100.0% (25 of 25 strings)

Translation: sale-workflow-17.0/sale-workflow-17.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-17-0/sale-workflow-17-0-sale_product_set/it/
[MIG] sale_product_set: add migration to 18.0 for syncing product set state
Currently translated at 100.0% (25 of 25 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-sale_product_set
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-sale_product_set/tr/
@rousseldenis
Copy link
Copy Markdown
Contributor

/ocabot migration sale_product_set

@rousseldenis
Copy link
Copy Markdown
Contributor

@mmrondon Thanks for this.

Could you put in this' description the libnk to the depending PR (product_set)?

Moreover, you can embed it too here in order to test it thourgh runboat and make tests running following https://github.com/OCA/maintainer-tools/wiki/Use-temporary-reference%28s%29-to-another-pull-request%28s%29

@mmrondon
Copy link
Copy Markdown
Contributor Author

Dependency PR: OCA/product-attribute#2098

@rousseldenis
Copy link
Copy Markdown
Contributor

An idea is to no more use odoo-test-helper but I'm not sure we can remove it yet. See: OCA/server-tools#3417 (comment)

Copy link
Copy Markdown

@alexey-pelykh alexey-pelykh left a comment

Choose a reason for hiding this comment

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

Review: [19.0][MIG] sale_product_set

Thank you for working on this migration. I reviewed the full module code on the branch (Python models, wizard, views, tests, security, demo data) against Odoo 19.0 requirements and OCA conventions. Below are the findings.


Critical: All CI Checks Failing

All four CI checks are red:

  • pre-commit: FAILED
  • test with Odoo: FAILED
  • test with OCB: FAILED
  • Detect unreleased dependencies: FAILED

These must all pass before the PR can be merged.


Critical: Unreleased Dependency product_set

The __manifest__.py declares "depends": ["sale", "sale_management", "product_set"]. The product_set module lives in OCA/product-attribute and has not been merged to the 19.0 branch yet. There is an open migration PR (OCA/product-attribute#2098) but it also has CI failures.

This is the root cause of the "Detect unreleased dependencies" failure and likely cascades into the test failures (module cannot be installed).

Action needed: Coordinate with OCA/product-attribute#2098 to get product_set merged first, or at minimum ensure both PRs are CI-green so they can land together.


Migration Completeness: Version Bump Only

Comparing the PR branch content to 18.0, the only change is the version bump in __manifest__.py (18.0.1.0.019.0.1.0.0). No code was adapted for Odoo 19.0 API changes.

While a clean version bump is valid when the upstream API hasn't changed, the following items should be explicitly verified against Odoo 19.0 (and may require adaptation):

1. Test Demo Data Reference: sale.sale_order_6

The test file (tests/test_product_set.py) uses:

cls.so = cls.env.ref("sale.sale_order_6")

Odoo periodically restructures demo/test data across versions. If sale.sale_order_6 was removed or renamed in 19.0, all tests will fail at setUpClass. Other working 19.0 modules in this repo create sale orders programmatically in setUpClass rather than relying on external demo refs. Please verify this reference exists in Odoo 19.0, or refactor the test setup to create orders programmatically.

2. Sale Order View XPath: action_add_from_catalog

In views/sale_order.xml, the view inherits sale.view_order_form and targets:

<xpath expr="//button[@name='action_add_from_catalog']" position="before">

If this button was renamed, moved, or removed in Odoo 19.0, the view will fail to load. Please verify this XPath target against the Odoo 19.0 sale order form view.

3. Domain Expression: parent.state

The same view uses:

invisible="parent.state not in ['draft', 'sent']"

While draft and sent states exist in Odoo 17/18/19, the parent. prefix syntax for accessing parent model fields in embedded views should be verified for 19.0. Some Odoo versions changed domain evaluation behavior.

4. product_uom_id Field in prepare_sale_order_line_values

In models/product_set_line.py:

"product_uom_id": self.product_id.uom_id.id,

Odoo has renamed product_uom to product_uom_id at different points. Please verify the sale order line model field name in 19.0.

5. self.env._() Usage

The wizard uses self.env._("...") for translations, which is the correct pattern for Odoo 17+. This is fine.


Minor: Pre-commit Failures

The pre-commit check is failing. Common causes for migration PRs:

  • Missing newline at end of file
  • Trailing whitespace
  • Import ordering
  • OCA linting rules

Please run pre-commit run --all-files locally and fix any issues.


Summary

Item Severity Status
CI all red (4/4 failing) Blocker Must fix
product_set dependency not on 19.0 Blocker Coordinate with product-attribute#2098
sale.sale_order_6 test ref Likely blocker Verify or refactor
action_add_from_catalog XPath Needs verification May break view loading
parent.state domain syntax Needs verification May break view loading
product_uom_id field name Needs verification May break SO line creation
pre-commit failures Must fix Run locally

Once the product_set dependency is available on 19.0 and CI can actually install the module, the test/view issues above should become visible. I recommend:

  1. Coordinate with product-attribute#2098 first
  2. Fix pre-commit issues locally
  3. Verify all Odoo 19.0 API items listed above
  4. Push fixes and confirm CI goes green

@MohamedOsman7
Copy link
Copy Markdown
Contributor

MohamedOsman7 commented Mar 25, 2026

@mmrondon please check #3941 (review)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.