From 8f43b749f40bb4923283407a24487474b567e1c9 Mon Sep 17 00:00:00 2001 From: Martin Trigaux Date: Thu, 8 May 2014 15:49:37 +0200 Subject: [PATCH] [FIX] product: when duplicating a product, keep the language in the context At the time of the context_wo_lang patch (7.0 revision 6577), the orm did not keep the language in copy_data, this patch intended to be more consistent. Since server revision 5146 7.0, the new behaviour is to use the translated version in copy_data. Removign this change will be more consistent with the orm. The expected behaviour is now the following: In user lang: translated product name + translated '(copy)' In other lang: same as original product lp bug: https://launchpad.net/bugs/1159913 fixed bzr revid: mat@openerp.com-20140508134937-7cbja3vsv311z5j4 --- addons/product/product.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 5d6fb7a15bc..ce17af7f88f 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -728,11 +728,7 @@ class product_product(osv.osv): if not default: default = {} - # Craft our own ` (copy)` in en_US (self.copy_translation() - # will do the other languages). - context_wo_lang = context.copy() - context_wo_lang.pop('lang', None) - product = self.read(cr, uid, id, ['name'], context=context_wo_lang) + product = self.read(cr, uid, id, ['name'], context=context) default = default.copy() default.update(name=_("%s (copy)") % (product['name']))