odoo/odoo#258458
Created by fw-bot
Statuses:
- legal/cla: Contributor License Agreement check
- ci/runbot: Odoo Test Suite
- ci/upgrade_enterprise: Test upgrades for enterprise master
- ci/template: (runtime 1724s)
- ci/style: Optional style check. Ignore it only if strictly necessary.
- ci/security: Required security check. Can only be ignored by security team.
- ci/l10n: (runtime 21s)
- label
- odoo-dev:18.0-17.0-opw-5955875-account_product_name_translation-esand-509483-fw
- head
- 6af745b671ebfe9fdbcf2762f041cc23f0409755
- merged
- 1 day ago by Ester Andreetto (esand)
| odoo/odoo | |
|---|---|
| 17.0 | #254833 |
| 18.0 | #258458 |
| saas-18.2 | #258615 missing r+ |
| saas-18.3 | #258660 missing r+ |
| saas-18.4 | #258707 missing r+ |
| 19.0 | #258737 missing r+ |
| saas-19.1 | #258768 missing r+ |
| saas-19.2 | #258789 missing r+ |
| master | #258801 missing r+ |
[FIX] account: display product name in correct language in an invoice
Issue before this commit:
When creating an invoice using the child contact of a parent contact that has a different language with respect to the father, the label of the invoice line was not always displayed in the child contact language but in the father's contact language.
Steps to reproduce the issue:
- Activate at least 2 languages (X and Y)
- Create a product and set the translation for that product in the activated languages
- Create a Contact with the language X
- Create a child contact (invoice adress type) for that contact with language Y
- Create a new invoice setting the customer as the child contact
- Add the product you created
- See the label is displayed in the language of the parent contact
Cause of the issue:
The computation of the invoice line name relied on line.partner_id.lang. However, the partner_id of the move line is automatically set to the commercial partner that can be different (can be the father's contact) to the contact used on the invoice. As a result, the product description was translated using the wrong language.
Reason to introduce the fix:
To ensure that invoice line labels are correctly translated according to the language of the selected invoice contact, the computation now uses the language of move_id.partner_id instead of line.partner_id. This guarantees consistent and expected behavior in multilingual environments, especially when using different contacts under the same commercial partner.
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: #254833