=== modified file 'product/product.py' --- product/product.py 2009-08-07 07:26:47 +0000 +++ product/product.py 2009-08-07 11:31:40 +0000 @@ -633,6 +633,11 @@ def copy(self, cr, uid, id, default=None, context=None): if not context: context={} + product = self.browse(cr, uid, id, context=context) + if not default: + default = {} + default = default.copy() + default['name'] = (product['name'] or '') + ' (copy)'
if ('variant' in context) and context['variant']: fields = ['product_tmpl_id', 'active', 'variants', 'default_code',
=== modified file 'product/ product. py'
context= {}
--- product/product.py 2009-08-07 07:26:47 +0000
+++ product/product.py 2009-08-07 11:31:40 +0000
@@ -633,6 +633,11 @@
def copy(self, cr, uid, id, default=None, context=None):
if not context:
+ product = self.browse(cr, uid, id, context=context)
+ if not default:
+ default = {}
+ default = default.copy()
+ default['name'] = (product['name'] or '') + ' (copy)'
if ('variant' in context) and context['variant']:
fields = ['product_tmpl_id', 'active', 'variants', 'default_code',