[IMP] product: ensure variant price is managed on the template
* variant prices should be read only on the variant * added an help to explain how it works * because variant prices are managed on the template via the Variant Prices button
This commit is contained in:
committed by
Thibault Delavallée
parent
9e84bf8217
commit
986b152f16
@@ -116,7 +116,8 @@ class ProductProduct(models.Model):
|
||||
help="This is the sum of the extra price of all attributes")
|
||||
lst_price = fields.Float(
|
||||
'Sale Price', compute='_compute_product_lst_price',
|
||||
digits=dp.get_precision('Product Price'), inverse='_set_product_price')
|
||||
digits=dp.get_precision('Product Price'), inverse='_set_product_price',
|
||||
help="The sale price is managed from the product template. Click on the 'Variant Prices' button to set the extra attribute prices.")
|
||||
|
||||
default_code = fields.Char('Internal Reference', index=True)
|
||||
code = fields.Char('Internal Reference', compute='_compute_product_code')
|
||||
|
||||
@@ -224,7 +224,8 @@
|
||||
</group>
|
||||
<group>
|
||||
<group name="pricing" string="Pricing">
|
||||
<field name="lst_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="product_variant_count" invisible="1"/>
|
||||
<field name="lst_price" widget='monetary' options="{'currency_field': 'currency_id'}" attrs="{'readonly': [('product_variant_count', '>', 1)]}"/>
|
||||
<field name="standard_price" widget='monetary' options="{'currency_field': 'currency_id'}"/>
|
||||
<field name="currency_id" invisible='1'/>
|
||||
</group>
|
||||
@@ -310,6 +311,7 @@
|
||||
</field>
|
||||
<field name="list_price" position="attributes">
|
||||
<attribute name="name">lst_price</attribute>
|
||||
<attribute name="attrs">{'readonly': [('product_variant_count', '>', 1)]}</attribute>
|
||||
</field>
|
||||
<field name="name" position="after">
|
||||
<field name="product_tmpl_id" class="oe_inline" readonly="1" invisible="1" attrs="{'required': [('id', '!=', False)]}"/>
|
||||
|
||||
Reference in New Issue
Block a user