Skip to content

[19.0][MIG] product_customerinfo_sale#4111

Open
JasminSForgeFlow wants to merge 54 commits intoOCA:19.0from
ForgeFlow:19.0-mig-product_customerinfo_sale
Open

[19.0][MIG] product_customerinfo_sale#4111
JasminSForgeFlow wants to merge 54 commits intoOCA:19.0from
ForgeFlow:19.0-mig-product_customerinfo_sale

Conversation

@JasminSForgeFlow
Copy link
Copy Markdown
Contributor

@JasminSForgeFlow JasminSForgeFlow commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

@AaronHForgeFlow AaronHForgeFlow left a comment

Choose a reason for hiding this comment

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

Functional test 👍

@rousseldenis
Copy link
Copy Markdown
Contributor

/ocabot migration product_customerinfo_sale

@OCA-git-bot OCA-git-bot added this to the 19.0 milestone Jan 22, 2026
gediminasvenc added a commit to linserv/sale-workflow that referenced this pull request Feb 10, 2026
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.

Thanks for the migration, looks solid overall -- tests are thorough and the code is clean.

One functional concern: _compute_product_customer_code depends only on product_id, but the computation uses order_partner_id. If the partner on the SO changes after a line already exists, the customer code won't recompute. Adding order_partner_id to the @api.depends would fix this.

Also a minor cleanup note: i18n/product_supplierinfo_for_customer_sale.pot is a leftover from the old module name and can be removed.

)

@api.depends("product_id")
def _compute_product_customer_code(self):
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This depends on product_id only, but the body calls _select_customerinfo(partner=line.order_partner_id). If the SO partner changes after lines exist, the customer code won't refresh. Consider:

@api.depends("product_id", "order_partner_id")

if customerinfo.product_code:
item.name = f"[{customerinfo.product_code}] {item.name}"
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: the bare return at the end of the method is unnecessary (Python returns None implicitly). Feel free to drop it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This will cause missing-return warning in pre-commit

@@ -0,0 +1,30 @@
# Translation of Odoo Server.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This .pot file still references the old module name product_supplierinfo_for_customer_sale. Looks like a leftover from a previous version -- safe to remove.

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.

Thanks for migrating this to 19.0. The onchange rename (_onchange_product_id_warning -> _onchange_product_id) and the test adaptations (own product fixtures instead of demo data refs, group_ids rename) are the right changes for the new version.

One point that I flagged in my inline comments earlier and still stands: _compute_product_customer_code depends only on product_id, but the body reads order_partner_id to select the customerinfo. Since order_partner_id is a stored related field, adding it to @api.depends would make the code recompute correctly when the SO partner changes. This is technically a pre-existing issue from 18.0, but worth fixing while we're here.

The stale i18n/product_supplierinfo_for_customer_sale.pot is a leftover from the old module name and can be dropped.

Otherwise the manifest, security, views, and tests all look correct for 19.0.

AaronHForgeFlow and others added 21 commits March 4, 2026 04:34
[REF] product_supplierinfo_for_customer_sale: Changes in test.

[REF] product_supplierinfo_for_customer_sale: Complete README.rst
…rch, products found by default code and customer code

[REF] product_supplierinfo_for_customer_sale: Add test to find more than one product in name_search

[REF] product_supplierinfo_for_customer_sale: In test find one product from customer code and other one from product default code.

[REF] product_supplierinfo_for_customer_sale: Changes in name_search to work exactly with number of limit defined.

[REF] product_supplierinfo_for_customer_sale: Changes in name_search
 - New field name from type to supplierinfo_type
 - Remove copyright for __init__.py
 - Re-using variables from tests
 - Manifest bump version and using module url
 - Get commit history from
 https://github.com/OCA/product-attribute/tree/8.0/product_supplierinfo_for_customer_sale
    - Run 2to3 script
    - view fixing
… instead of manual assign.

 - Removing duplicated test for name_search
Updated by Update PO files to match POT (msgmerge) hook in Weblate.
There's no price computation on the module, so there shouldn't be any test regarding
this topic, or it can fail in integration tests.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: sale-workflow-12.0/sale-workflow-12.0-product_supplierinfo_for_customer_sale
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-product_supplierinfo_for_customer_sale/
francesco-ooops and others added 26 commits March 4, 2026 04:34
Currently translated at 100.0% (6 of 6 strings)

Translation: sale-workflow-14.0/sale-workflow-14.0-product_supplierinfo_for_customer_sale
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-14-0/sale-workflow-14-0-product_supplierinfo_for_customer_sale/it/
…s all product.customerinfo

[UPD] Update product_supplierinfo_for_customer_sale.pot

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

Translation: sale-workflow-16.0/sale-workflow-16.0-product_supplierinfo_for_customer_sale
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-product_supplierinfo_for_customer_sale/
Currently translated at 100.0% (6 of 6 strings)

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

Translation: sale-workflow-16.0/sale-workflow-16.0-product_supplierinfo_for_customer_sale
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-product_supplierinfo_for_customer_sale/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-product_supplierinfo_for_customer_sale
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-product_supplierinfo_for_customer_sale/de/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-16.0/sale-workflow-16.0-product_supplierinfo_for_customer_sale
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-product_supplierinfo_for_customer_sale/it/
…Form() to change line name properly

TT49073

Co-Authored-By: Pedro M. Baeza <pedro.baeza@tecnativa.com>
… onchange

The previous code was trying to avoid a double search on customerinfo
passing by context the already searched customerinfo, but the ORM makes
some artifacts (like duplicating one2many references with NewId records)
on that cases, provoking the call chain to fail when comparing .id on
NewId.

The solution is to not pass anything by context and do the search 2
times. Anyway, the performance improvement was low, having data in
cache.

TT49073
In OCA#3163 the test where changed and try to set a field restricted to a
group that the user used in the test don't have.
renamed from product_supplierinfo_for_customer
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-product_customerinfo_sale
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-product_customerinfo_sale/nl/
Currently translated at 100.0% (3 of 3 strings)

Translation: sale-workflow-18.0/sale-workflow-18.0-product_customerinfo_sale
Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-18-0/sale-workflow-18-0-product_customerinfo_sale/it/
@JasminSForgeFlow JasminSForgeFlow force-pushed the 19.0-mig-product_customerinfo_sale branch from 68f11da to a1a1dee Compare March 4, 2026 04:34
@JasminSForgeFlow
Copy link
Copy Markdown
Contributor Author

Thanks for migrating this to 19.0. The onchange rename (_onchange_product_id_warning -> _onchange_product_id) and the test adaptations (own product fixtures instead of demo data refs, group_ids rename) are the right changes for the new version.

One point that I flagged in my inline comments earlier and still stands: _compute_product_customer_code depends only on product_id, but the body reads order_partner_id to select the customerinfo. Since order_partner_id is a stored related field, adding it to @api.depends would make the code recompute correctly when the SO partner changes. This is technically a pre-existing issue from 18.0, but worth fixing while we're here.

The stale i18n/product_supplierinfo_for_customer_sale.pot is a leftover from the old module name and can be dropped.

Otherwise the manifest, security, views, and tests all look correct for 19.0.

Updated, Thanks

Copy link
Copy Markdown
Contributor

@BhaveshHeliconia BhaveshHeliconia left a comment

Choose a reason for hiding this comment

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

LGTM!

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.