[FIX] product: make copy friendlier to overrides

Do not force to use "<name> (copy)" when duplicating

Closes #12397
This commit is contained in:
Stefan Rijnhart 2016-06-13 19:37:36 +02:00 committed by Martin Trigaux
parent baa4cc0e97
commit 606eab8ef8
No known key found for this signature in database
GPG Key ID: 7B0E288E7C0F83A7
1 changed files with 3 additions and 2 deletions

View File

@ -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 = {