Hello,
I am creating a custom view in Odoo13, extending sale.view_order_tree, but get the following error message when installing the extension module i am working with.
odoo.exceptions.ValidationError: ('Error while validating view\n\nField `opportunity_id` does not exist\n\nError context:\nView `lco.sale.order.tree`\n[view_id: 1036, xml_id: n/a, model: sale.order, parent_id: 932]', None)
I had doubled check model sale.order to verify that field opportunity_id exisits, this is a field contained in sale.order standard table, even I created a new custom view using studio and it works as expected, shows opportuniy_id field.
Also I try with another field for the same table 'partner.id', and my custom view works perfectly, it only happens with opportunity_id field.
Here is the XML of my view.
<?xml version="1.0"?>
<odoo>
<record id="lco_view_order_tree" model="ir.ui.view">
<field name="name">lco.sale.order.tree</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_tree" />
<field name="arch" type="xml">
<field name="invoice_status" position="after">
<field name="opportunity_id"/>
</field>
</field>
</record>
</odoo>
Also I understood this field comes from crm.lead table in a many2one relationship, am i missing any specific detail for importing this kind of field?
Appreciate your help.