[FIX] product,*: empty group in view

Since #75862, the group "Upsell & Cross Sell" was shown in the "Sales"
tab of the product views, even if empty (its content is only defined in modules
sale_product_configurator & website_sale).

This commit makes sure that the group is invisible while it has no content.

closes odoo/odoo#93504

X-original-commit: 4f6c15f07141da80525e0c361a6fa19374ef4c2c
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
Victor Feyens
2022-06-13 20:37:35 +02:00
parent b71455c328
commit 39d0f38738
3 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -101,7 +101,7 @@
</page>
<page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales" invisible="1">
<group name="sale">
<group string="Upsell &amp; Cross-Sell" name="upsell"/>
<group string="Upsell &amp; Cross-Sell" name="upsell" invisible="1"/>
</group>
<group>
<group string="Sales Description" name="description">
@@ -6,6 +6,9 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<group name="upsell" position="attributes">
<attribute name="invisible">0</attribute>
</group>
<group name="upsell" position="inside">
<field name="optional_product_ids"
widget="many2many_tags"
@@ -142,6 +142,9 @@
<div name="button_box" position="inside">
<field name="is_published" widget="website_redirect_button" attrs="{'invisible': [('sale_ok','=',False)]}"/>
</div>
<group name="upsell" position="attributes">
<attribute name="invisible">0</attribute>
</group>
<xpath expr="//group[@name='upsell']" position="inside">
<field name="accessory_product_ids" widget="many2many_tags" attrs="{'invisible': [('sale_ok','=',False)]}"
placeholder="Suggested accessories in the eCommerce cart"/>