[imp] add code note for product.py and improve template demo.
bzr revid: amb@tinyerp.com-20131128110703-hjpru7kjwvaqfg6p
This commit is contained in:
@@ -478,6 +478,9 @@ class product_template(osv.osv):
|
||||
default = default.copy()
|
||||
default.update(name=_("%s (copy)") % (template['name']))
|
||||
id = super(product_template, self).copy(cr, uid, id, default=default, context=context)
|
||||
'''Note: while copy a template at that time create variants(product)
|
||||
with old value. and due to inherits product_tmpl_id, It's update the
|
||||
new template name. So we are update new template name with copy.'''
|
||||
if template['product_variant_ids']:
|
||||
self.write(cr, uid, id, default, context)
|
||||
return id
|
||||
|
||||
@@ -620,7 +620,7 @@ QWERTY keyboard</field>
|
||||
|
||||
|
||||
<record id="product_template_29" model="product.template">
|
||||
<field name="name">Pen Drive, SP-2</field>
|
||||
<field name="name">Pen Drive</field>
|
||||
<field name="categ_id" ref="product_category_7"/>
|
||||
<field name="public_categ_id" ref="Pen_Drive"/>
|
||||
<field name="standard_price">90.0</field>
|
||||
|
||||
Reference in New Issue
Block a user