[19.0][MIG] product_customerinfo_sale#4111
[19.0][MIG] product_customerinfo_sale#4111JasminSForgeFlow wants to merge 54 commits intoOCA:19.0from
Conversation
AaronHForgeFlow
left a comment
There was a problem hiding this comment.
Functional test 👍
|
/ocabot migration product_customerinfo_sale |
alexey-pelykh
left a comment
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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 | ||
|
|
There was a problem hiding this comment.
Nit: the bare return at the end of the method is unnecessary (Python returns None implicitly). Feel free to drop it.
There was a problem hiding this comment.
This will cause missing-return warning in pre-commit
| @@ -0,0 +1,30 @@ | |||
| # Translation of Odoo Server. | |||
There was a problem hiding this comment.
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.
alexey-pelykh
left a comment
There was a problem hiding this comment.
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.
[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.
types: int() >= NoneType()
…fo by product variant first
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/
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/
…ale module for supplierinfo model TT38757
…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/
68f11da to
a1a1dee
Compare
Updated, Thanks |
Standard Migration
@ForgeFlow
Depends on: