[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:
Goffin Simon
2017-04-06 17:13:15 +02:00
parent 5219dcbae3
commit 428d9e8177
+2 -1
View File
@@ -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