From 606eab8ef8d904aed9c83f9cb5b61e237b13b586 Mon Sep 17 00:00:00 2001 From: Stefan Rijnhart Date: Mon, 13 Jun 2016 19:37:36 +0200 Subject: [PATCH] [FIX] product: make copy friendlier to overrides Do not force to use " (copy)" when duplicating Closes #12397 --- addons/product/product.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/product/product.py b/addons/product/product.py index 75e9ccfcc22..c2c081630d3 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -784,8 +784,9 @@ class product_template(osv.osv): def copy(self, cr, uid, id, default=None, context=None): if default is None: default = {} - template = self.browse(cr, uid, id, context=context) - default['name'] = _("%s (copy)") % (template['name']) + if 'name' not in default: + template = self.browse(cr, uid, id, context=context) + default['name'] = _("%s (copy)") % (template['name']) return super(product_template, self).copy(cr, uid, id, default=default, context=context) _defaults = {