Skip to content

[FIX] account: display product name in correct language in an invoice#258458

Closed
fw-bot wants to merge 1 commit intoodoo:18.0from
odoo-dev:18.0-17.0-opw-5955875-account_product_name_translation-esand-509483-fw
Closed

[FIX] account: display product name in correct language in an invoice#258458
fw-bot wants to merge 1 commit intoodoo:18.0from
odoo-dev:18.0-17.0-opw-5955875-account_product_name_translation-esand-509483-fw

Conversation

@fw-bot
Copy link
Copy Markdown
Contributor

@fw-bot fw-bot commented Apr 9, 2026

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:

  1. Activate at least 2 languages (X and Y)
  2. Create a product and set the translation for that product in the activated languages
  3. Create a Contact with the language X
  4. Create a child contact (invoice adress type) for that contact with language Y
  5. Create a new invoice setting the customer as the child contact
  6. Add the product you created
  7. 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.

opw-5955875


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #254833

@robodoo
Copy link
Copy Markdown
Contributor

robodoo commented Apr 9, 2026

Pull request status dashboard

@fw-bot
Copy link
Copy Markdown
Contributor Author

fw-bot commented Apr 9, 2026

@eesteerina @svfu-odoo cherrypicking of pull request #254833 failed.

stdout:

Auto-merging addons/account/models/account_move_line.py
Auto-merging addons/account/tests/test_account_move_entry.py
CONFLICT (content): Merge conflict in addons/account/tests/test_account_move_entry.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

:shipit: you can use git-fw to re-do the forward-port for you locally.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added forwardport This PR was created by @fw-bot conflict There was an error while creating this forward-port PR labels Apr 9, 2026
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:
1. Activate at least 2 languages (X and Y)
2. Create a product and set the translation for that product in the
activated languages
3. Create a Contact with the language X
4. Create a child contact (invoice adress type) for that contact with
language Y
5. Create a new invoice setting the customer as the child contact
6. Add the product you created
7. 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.

opw-5955875

X-original-commit: 60ef56f
@eesteerina eesteerina force-pushed the 18.0-17.0-opw-5955875-account_product_name_translation-esand-509483-fw branch from 8cb8b40 to 6af745b Compare April 9, 2026 19:24
@eesteerina
Copy link
Copy Markdown
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Apr 10, 2026
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:
1. Activate at least 2 languages (X and Y)
2. Create a product and set the translation for that product in the
activated languages
3. Create a Contact with the language X
4. Create a child contact (invoice adress type) for that contact with
language Y
5. Create a new invoice setting the customer as the child contact
6. Add the product you created
7. 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.

opw-5955875

closes #258458

X-original-commit: 60ef56f
Signed-off-by: Sven Führ (svfu) <svfu@odoo.com>
Signed-off-by: Ester Andreetto (esand) <esand@odoo.com>
@robodoo robodoo closed this Apr 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR forwardport This PR was created by @fw-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants