[IMP] product: move group inside the view

The goal being to get rid of the `groups_id` feature for backend views

Part-of: odoo/odoo#98551
This commit is contained in:
Denis Ledoux
2022-08-29 22:42:54 +02:00
parent 170b99b71d
commit 9f89137bb2
@@ -73,7 +73,7 @@
<notebook>
<page name="pricelist_rules" string="Price Rules">
<field name="item_ids" nolabel="1" context="{'default_base':'list_price'}">
<tree string="Pricelist Rules" editable="bottom">
<tree groups="!product.group_sale_pricelist" string="Pricelist Rules" editable="bottom">
<field name="product_tmpl_id" string="Products" required="1"/>
<field name="product_id" string="Variants"
groups="product.group_product_variant"
@@ -90,6 +90,21 @@
<field name="applied_on" invisible="1"/>
<field name="company_id" invisible="1"/>
</tree>
<!-- When in advanced pricelist mode : pricelist rules
Should open in a form view and not be editable inline anymore.
-->
<tree groups="product.group_sale_pricelist" string="Pricelist Rules">
<field name="product_tmpl_id" invisible="1"/>
<field name="name" string="Applicable On"/>
<field name="min_quantity"/>
<field name="price" string="Price"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="base" invisible="1"/>
<field name="price_discount" invisible="1"/>
<field name="applied_on" invisible="1"/>
<field name="compute_price" invisible="1"/>
</tree>
</field>
</page>
<page name="pricelist_config" string="Configuration">
@@ -108,34 +123,6 @@
</field>
</record>
<record id="product_pricelist_view_inherit" model="ir.ui.view">
<field name="name">product.pricelist.form.inherit</field>
<field name="model">product.pricelist</field>
<field name="inherit_id" ref="product.product_pricelist_view"/>
<field name="groups_id" eval="[(4, ref('product.group_sale_pricelist'))]"/>
<field name="arch" type="xml">
<!-- When in advanced pricelist mode : pricelist rules
Should open in a form view and not be editable inline anymore.
-->
<field name="item_ids" position="replace">
<field name="item_ids" nolabel="1" context="{'default_base':'list_price'}" groups="product.group_product_pricelist">
<tree string="Pricelist Rules">
<field name="product_tmpl_id" invisible="1"/>
<field name="name" string="Applicable On"/>
<field name="min_quantity"/>
<field name="price" string="Price"/>
<field name="date_start"/>
<field name="date_end"/>
<field name="base" invisible="1"/>
<field name="price_discount" invisible="1"/>
<field name="applied_on" invisible="1"/>
<field name="compute_price" invisible="1"/>
</tree>
</field>
</field>
</field>
</record>
<record id="product_pricelist_action2" model="ir.actions.act_window">
<field name="name">Pricelists</field>
<field name="type">ir.actions.act_window</field>