From 428d9e81775dd470df6536ded4c6c56331efd760 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 5 Apr 2017 16:36:10 +0200 Subject: [PATCH] [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 --- odoo/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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