[FIX] stock_account: product_category_form inherit

Directly inheriting stock.product_category_form_view_inherit would raise
an error as group "account_property" wouldn't yet exist in the inherited
record.

Fixes 61d937f7d6

closes odoo/odoo#75822

Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
This commit is contained in:
clesgow
2021-09-01 09:38:58 +00:00
parent 3654addf5c
commit 79804719fe
+15 -7
View File
@@ -12,10 +12,24 @@
</field>
</record>
<record id="view_category_property_form_stock" model="ir.ui.view">
<field name="name">product.category.stock.property.form.inherit.stock</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="stock.product_category_form_view_inherit"/>
<field name="arch" type="xml">
<group name="logistics" position="after">
<group string="Inventory Valuation">
<field name="property_cost_method"/>
<field name="property_valuation" groups="account.group_account_readonly,stock.group_stock_manager"/>
</group>
</group>
</field>
</record>
<record id="view_category_property_form" model="ir.ui.view">
<field name="name">product.category.stock.property.form.inherit</field>
<field name="model">product.category</field>
<field name="inherit_id" ref="stock.product_category_form_view_inherit"/>
<field name="inherit_id" ref="account.view_category_property_form"/>
<field name="arch" type="xml">
<group name="account_property" position="inside">
<group name="account_stock_property" string="Account Stock Properties" groups="account.group_account_readonly" attrs="{'invisible':[('property_valuation', '=', 'manual_periodic')]}">
@@ -28,12 +42,6 @@
</div>
</group>
</group>
<group name="logistics" position="after">
<group string="Inventory Valuation">
<field name="property_cost_method"/>
<field name="property_valuation" groups="account.group_account_readonly,stock.group_stock_manager"/>
</group>
</group>
</field>
</record>
</data>