[FIX] mrp, purchase_requisition: hide empty variant description
Commit abef168389 adds the fields
'product_description_variant' on mrp.production and purchase.requisition
models. This text is taken from the product variant.
This commit make them invisible in case they are empty.
closes odoo/odoo#47716
Related: odoo/upgrade#948
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
@@ -115,7 +115,7 @@
|
||||
<field name="id" invisible="1"/>
|
||||
<field name="product_id" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
|
||||
<field name="product_tmpl_id" invisible="1"/>
|
||||
<field name="product_description_variants" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
|
||||
<field name="product_description_variants" attrs="{'invisible': [('product_description_variants', '=', False)], 'readonly': [('state', '!=', 'draft')]}"/>
|
||||
<label for="product_qty"/>
|
||||
<div class="o_row no-gutters d-flex">
|
||||
<div class="col">
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
<tree string="Products" editable="bottom">
|
||||
<field name="product_id" context="{'default_purchase_requisition': 'tenders'}"
|
||||
domain="[('purchase_ok', '=', True), '|', ('company_id', '=', False), ('company_id', '=', parent.company_id)]"/>
|
||||
<field name="product_description_variants" attrs="{'readonly': [('parent.state', '!=', 'draft')]}"/>
|
||||
<field name="product_description_variants" attrs="{'invisible': [('product_description_variants', '=', '')], 'readonly': [('parent.state', '!=', 'draft')]}"/>
|
||||
<field name="product_qty"/>
|
||||
<field name="qty_ordered" optional="show"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
|
||||
Reference in New Issue
Block a user