[FIX] mrp: action_open_product_lot is in the view product_product_form_view_bom_button

The button `action_open_product_lot` is added by the view `product_product_form_view_bom_button`.
Both the current view and the view `product_product_form_view_bom_button` inherited
from the view `product.product_normal_form_view`,
without any priority specified.

In order to make sure the button `action_open_product_lot` is in the view
when the view `product_product_form_view_bom_button` is loaded,
you either need to directly inherits from the view holding that button
`product_form_view_procurement_button`
either you need to increase the priority of the current view
so `product_product_form_view_bom_button` is loaded in priority.

Same thing for the view `product_template_form_view_bom_button`

Upgrade Request 47960

```
ValueError: Element '<xpath expr="//button[@name='action_open_product_lot']">' cannot be located in parent view

Error context:
View `product.product.procurement`
[view_id: 783, xml_id: mrp.product_product_form_view_bom_button, model: product.product, parent_id: 319]
```

closes odoo/odoo#51655

X-original-commit: 26fac2af85acb0ae9f9e479aec5eb16930d69e49
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
This commit is contained in:
Denis Ledoux
2020-05-22 01:42:30 +00:00
parent f5a8be7444
commit 0b27b4dde1
+2 -2
View File
@@ -72,7 +72,7 @@
<record id="product_template_form_view_bom_button" model="ir.ui.view">
<field name="name">product.template.procurement</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
<field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_open_product_lot']" position="after">
@@ -101,7 +101,7 @@
<record id="product_product_form_view_bom_button" model="ir.ui.view">
<field name="name">product.product.procurement</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="inherit_id" ref="stock.product_form_view_procurement_button"/>
<field name="groups_id" eval="[(4, ref('mrp.group_mrp_user'))]"/>
<field name="arch" type="xml">
<xpath expr="//button[@name='action_open_product_lot']" position="after">