summaryrefslogtreecommitdiff
path: root/odoo/models.py
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2017-04-05 16:36:10 +0200
committerGoffin Simon <sig@odoo.com>2017-04-06 17:13:15 +0200
commit428d9e81775dd470df6536ded4c6c56331efd760 (patch)
treeafb48a64e1d00f6d4092dcd0f266562ca02fb125 /odoo/models.py
parent5219dcbae3fc865034aa1dc23c6819c4413228f9 (diff)
[FIX] odoo: Copy a record in other language than US
When copying a record in an other language L than US, first a translation was created for L by the create called in the copy function and afterwards, a second translation was created by the function copy_translations So there were two duplicated translations for L instead of one. opw:706865
Diffstat (limited to 'odoo/models.py')
-rw-r--r--odoo/models.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/odoo/models.py b/odoo/models.py
index 51494a5d995..3c58f934520 100644
--- a/odoo/models.py
+++ b/odoo/models.py
@@ -4379,7 +4379,8 @@ class BaseModel(object):
"""
self.ensure_one()
vals = self.copy_data(default)[0]
- new = self.create(vals)
+ # To avoid to create a translation in the lang of the user, copy_translation will do it
+ new = self.with_context(lang=None).create(vals)
self.copy_translations(new)
return new