Skip to content
Permalink
Browse files

[IMP] product: hide sale/taxes related fields if product not sellable

This commit will hide the sale and taxes related fields in the form view if the product
is not 'sale_ok'.

Task #1936865
Closes #30903
  • Loading branch information...
rja-odoo authored and mba-odoo committed Feb 7, 2019
1 parent a7ac71e commit 82cde41866ad365b6585d3b72f0602ff1b9709ae
@@ -28,7 +28,7 @@
</page>
</page>
<field name="list_price" position="after">
<field name="taxes_id" widget="many2many_tags"/>
<field name="taxes_id" widget="many2many_tags" attrs="{'invisible': [('sale_ok', '=', False)]}"/>
</field>
<group name="bill" position="inside">
<field name="supplier_taxes_id" widget="many2many_tags"/>
@@ -8,7 +8,8 @@
<field name="sequence" widget="handle"/>
<field name="default_code"/>
<field name="name"/>
<field name="list_price" string="Sales Price"/>
<field name="sale_ok" invisible="1"/>
<field name="list_price" string="Sales Price" attrs="{'invisible': [('sale_ok', '=', False)]}"/>
<field name="standard_price"/>
<field name="categ_id"/>
<field name="type"/>
@@ -71,6 +72,7 @@
<field name="product_variant_count"/>
<field name="currency_id"/>
<field name="activity_state"/>
<field name="sale_ok"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
@@ -89,7 +91,7 @@
</strong>
</div>
<div name="tags"/>
<ul>
<ul t-if="record.sale_ok.raw_value">
<li>Price: <field name="lst_price" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}"></field></li>
</ul>
<div name="tags"/>
@@ -49,7 +49,7 @@
<field name="categ_id" string="Product Category"/>
</group>
<group name="group_standard_price">
<field name="list_price" string="Sales Price" widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}"/>
<field name="list_price" string="Sales Price" widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}" attrs="{'invisible': [('sale_ok', '=', False)]}"/>
<label for="standard_price" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1), ('is_product_variant', '=', False)]}"/>
<div name="standard_price_uom" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1), ('is_product_variant', '=', False)]}" class="o_row">
<field name="standard_price" widget='monetary' options="{'currency_field': 'cost_currency_id'}"/>
@@ -360,7 +360,8 @@
<field name="default_code"/>
<field name="name"/>
<field name="attribute_value_ids" widget="many2many_tags" groups="product.group_product_variant"/>
<field name="lst_price"/>
<field name="sale_ok" invisible="1"/>
<field name="lst_price" attrs="{'invisible': [('sale_ok', '=', False)]}"/>
<field name="standard_price"/>
<field name="type" invisible="1"/>
<field name="price" invisible="not context.get('pricelist',False)"/>
@@ -388,7 +389,7 @@
</field>
<field name="list_price" position="attributes">
<attribute name="name">lst_price</attribute>
<attribute name="attrs">{'readonly': [('product_variant_count', '&gt;', 1)]}</attribute>
<attribute name="attrs">{'invisible': [('sale_ok', '=', False)], 'readonly': [('product_variant_count', '&gt;', 1)]}</attribute>
</field>
<group name="packaging" position="attributes">
<attribute name="attrs">{'invisible': 0}</attribute>
@@ -432,6 +433,7 @@
<field name="image_small"/>
<field name="lst_price"/>
<field name="activity_state"/>
<field name="sale_ok"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
<templates>
<t t-name="kanban-box">
@@ -447,7 +449,7 @@
<div class="o_kanban_tags_section">
<field name="attribute_value_ids" groups="product.group_product_variant"/>
</div>
<ul>
<ul t-if="record.sale_ok.raw_value">
<li><strong>Price: <field name="lst_price"></field></strong></li>
</ul>
<div name="tags"/>

0 comments on commit 82cde41

Please sign in to comment.
You can’t perform that action at this time.