[FIX] product: display barcode field on new products
Following 459760c, the `barcode` field wouldn't appear on a new product
form until the form was saved at least once.
This was due to the new product not having any variants until it was
saved.
In the case of the product not having any variants, we check if it does
have a least one attribute at the same time (which would be the case for
dynamic attributes).
closes odoo/odoo#121925
X-original-commit: 5f3db6683ab191cb68af4c8d6bb2e86a5b114ee1
Signed-off-by: Steve Van Essche <svs@odoo.com>
This commit is contained in:
@@ -43,7 +43,8 @@
|
||||
</xpath>
|
||||
<field name="categ_id" position="after">
|
||||
<field name="default_code" attrs="{'invisible': [('product_variant_count', '>', 1)]}"/>
|
||||
<field name="barcode" attrs="{'invisible': ['|', ('product_variant_count', '>', 1), ('product_variant_count', '=', 0)]}"/>
|
||||
<field name="valid_product_template_attribute_line_ids" invisible="1"/>
|
||||
<field name="barcode" attrs="{'invisible': ['|', ('product_variant_count', '>', 1), '&', ('product_variant_count', '=', 0), ('valid_product_template_attribute_line_ids', '!=', [])]}"/>
|
||||
</field>
|
||||
|
||||
<div name="button_box" position="inside">
|
||||
|
||||
Reference in New Issue
Block a user