When I try to install the module where the following inherited view is defined i get the error
I checked
- https://www.odoo.com/es_ES/forum/ayuda-1/error-partner-bank-id-cannot-be-located-in-parent-view-odoo19-292645
- https://www.odoo.com/es_ES/forum/ayuda-1/error-msg-element-xpath-expr-cannot-be-located-in-parent-view-213940
And I verified that reference to the XML ID in my view is correct. The field show_forecasted_qty_status_button is listed from the debugger in the Product Template view.
<?xml version="1.0" encoding="utf-8"?> <odoo> <record id="product_template_procurement_form_hide_forecast" model="ir.ui.view"> <field name="name">product.template.procurement.form.hide.forecast</field> <field name="model">product.template</field> <field name="inherit_id" ref="stock.product_template_form_view_procurement_button" /> <field name="priority">14</field> <field name="arch" type="xml"> <xpath expr="//field[@name='show_forecasted_qty_status_button']" position="attributes"> <attribute name="value">0</attribute> </xpath> </field> </record> </odoo>
The other thing I tried without success was to inherit the model in order to overwrite the method of the computed field. But the log entry was not listed in the log.
class ProductTemplate( models.Model ):
_logger = logging.getLogger(__name__)
_inherit = ['product.template']
"""
Removes the forecasted quantity button in product template view
@see commit abf1ee63f41094a313ead96caccc284c0b233244
"""
@api.depends('is_storable')
def _compute_show_qty_status_button(self):
self._logger.info('###################################### _compute_show_qty_status_button ########################################')
for template in self:
template.show_on_hand_qty_status_button = template.is_storable
template.show_forecasted_qty_status_button = False
Hello
I've test the same scenario in my local V18 env and not getting any error while installing or upgrading the module.