Comment 7 for bug 734191

Revision history for this message
Jacques-Etienne Baudoux (jbaudoux) wrote :

The issue in in product/product.py method copy.
Not clear why you use create instead of copy. If you use create, you must do:
> context_wo_lang = context.copy()
> if 'lang' in context:
> del context_wo_lang['lang']

< product = self.read(cr, uid, id, ['name'], context=context)
> product = self.read(cr, uid, id, ['name'], context=context_wo_lang)

< data = self.read(cr, uid, id, fields=fields, context=context)
> data = self.read(cr, uid, id, fields=fields, context=context_wo_lang)

and then manage the translation like done by copy_translations.

Maybe, this method should simply be rewritten to use super(product_product, self).copy instead of self.create