[FIX] product: allow user to set price at template creation
authorMartin Trigaux <mat@openerp.com>
Wed, 9 Jul 2014 11:20:48 +0000 (13:20 +0200)
committerMartin Trigaux <mat@openerp.com>
Wed, 9 Jul 2014 11:20:48 +0000 (13:20 +0200)
The lst_price field on product.template is a related to list_price. As we do not allow to set a value for related fields at creation (see orm.py , L4180), we display the list_price instead (float field).
On the product.product form, we display the lst_price (function field, readonly) as we don't want to allow changing the template price from the product. opw 609497

addons/product/product_view.xml

index ddecdea..b7d746c 100644 (file)
@@ -69,7 +69,7 @@
                                     <group>
                                         <field name="type"/>
                                         <field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)" groups="product.group_uom"/>
-                                        <field name="lst_price"/>
+                                        <field name="list_price"/>
                                     </group>
                                     <group>
                                         <field name="active"/>
                 <form position="attributes">
                     <attribute name="string">Product Variant</attribute>
                 </form>
+                <field name="list_price" position="attributes">
+                   <attribute name="name">lst_price</attribute>
+                </field>
                 <field name="name" position="replace">
                     <field name="name" attrs="{'invisible': [('id', '!=', False)]}"/>
                     <field name="product_tmpl_id" class="oe_inline" readonly="1" attrs="{'invisible': [('id', '=', False)], 'required': [('id', '!=', False)]}"/>