I,m trying to add field in sale order
this is code of my class:
from odoo import models , fields,api,_
class SaleOrder(models.Model):
_name='sale.order'
_inherit = 'sale.order'
warehouse_id=fields.Many2one("stock.warehouse")
and i inherit the view by this code and i added the field:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_sale_form_inherit" model="ir\.ui\.view\"\>
\ \ \ \ \ \ \ \ \ \ \ \ \<field\ name=\"name\"\>sale.order.inherit</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='sale_order_template_id']" position="after">
<field name="warehouse_id"/>
</xpath>
</field>
</record>
</data>
</odoo>
but the error occur:
Element '' cannot be located in parent view View error context: {'file': 'd:\\odoo16\\server\\odoo\\custom\\asmaa\\views\\sale_order.xml', 'line': 2, 'name': 'sale.order.inherit', 'view': ir.ui.view(1622,), 'view.model': 'sale.order', 'view.parent': ir.ui.view(795,), 'xmlid': 'view_sale_form_inherit'}