[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
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user