when implementing our own copy() method, and thus part
of the copy_data() method, we should do it in a consistent
way: copy_data() copy the name in en_US, so we should do
it in en_US too. Otherwise we end up writing the name of
the new product with a user-translated name.
lp bug: https://launchpad.net/bugs/799655 fixed
bzr revid: vmt@openerp.com-
20120214143420-7c16betfwlwblgjo
if context is None:
context={}
if context is None:
context={}
- product = self.read(cr, uid, id, ['name'], context=context)
if not default:
default = {}
if not default:
default = {}
+
+ # Craft our own `<name> (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)
- default['name'] = product['name'] + _(' (copy)')
+ default['name'] = product['name'] + ' (copy)'
if context.get('variant',False):
fields = ['product_tmpl_id', 'active', 'variants', 'default_code',
if context.get('variant',False):
fields = ['product_tmpl_id', 'active', 'variants', 'default_code',