From f6d69ff2d34a2b527c1f5447c18ee0acf4717c47 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Thu, 7 Jun 2018 13:30:11 +0200 Subject: [PATCH] [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 --- odoo/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/models.py b/odoo/models.py index d04e6642254..490c6f83cde 100644 --- a/odoo/models.py +++ b/odoo/models.py @@ -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