[FIX] odoo: copy_translation translates the wrong view
With website_version, when publishing a version and copying the current version, the copy_translation wrote a new translation for the copy of master in the published view instead of the copied view. Reason: When writing in the view, odoo checked in the context the current version and wrote in the view corresponding to the key and the verion seen in the website. So when copying a view, it translated the copied view instead of the copy of the view. The write is made by the function copy_translation with the line: "new_wo_lang[name] = old_wo_lang[name]" opw:1856150
This commit is contained in:
+1
-1
@@ -4411,7 +4411,7 @@ class BaseModel(object):
|
||||
vals = self.copy_data(default)[0]
|
||||
# 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)
|
||||
self.with_context(from_copy_translation=True).copy_translations(new)
|
||||
return new
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user