New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] models: do not copy translations from specified inherited records #27108

Merged
merged 1 commit into from Sep 20, 2018

Conversation

Projects
None yet
3 participants
@mart-e
Contributor

mart-e commented Sep 19, 2018

A copy call cn be made with a specified value to an inherits value, e.g.:

   self.env['product.product'].browse(42).copy({'product_tmpl_id': 1})

In such scenario, it is assumed the translations are already correct on the
specified related record and should not be used in the copy translation.
i.e. the translations of the product.template 1 must not be duplicated during
the copy call above

Show outdated Hide outdated odoo/models.py Outdated
Show outdated Hide outdated odoo/models.py Outdated
Show outdated Hide outdated odoo/models.py Outdated
Show outdated Hide outdated odoo/models.py Outdated

rdeodoo added a commit that referenced this pull request Sep 20, 2018

[FIX] website: avoid translation issue with copy on inherited record
Since Odoo saas-11.3, copying a record with it's inherited record in the copy
dict values will trigger translation of the inherited record's fields which it
shouldn't.

This issue will be fixed with #27108

In the meantime, we can avoid this issue by not copying the view separately
from the page as this code is a residue from the old implementation (no
inheritS between `website.page` and `ir.ui.view` + they both had `name` field)
and is not usefull anymore.
[FIX] models: do not copy translations from specified inherited records
A copy call cn be made with a specified value to an inherits value, e.g.:
   self.env['product.product'].browse(42).copy({'product_tmpl_id': 1})

In such scenario, it is assumed the translations are already correct on the
specified related record and should not be used in the copy translation.
i.e. the translations of the product.template 1 must not be duplicated during
the copy call above

Same logic for One2many fields which should not recursively copy the
translations for user provided values

Closes #27108

@mart-e mart-e merged commit 60e9e1f into odoo:saas-11.3 Sep 20, 2018

@mart-e mart-e deleted the odoo-dev:saas-11.3-copy-translation-inherit-default-mat branch Sep 21, 2018

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