[imp] add code note for product.py and improve template demo.

bzr revid: amb@tinyerp.com-20131128110703-hjpru7kjwvaqfg6p
This commit is contained in:
Amit Bhavsar (Open ERP)
2013-11-28 16:37:03 +05:30
parent 82d6ca2363
commit 8b75e738c1
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -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
+1 -1
View File
@@ -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>