I'm trying to learn inheritance but I get the following error when installing the module.
The "test" field does not exist in the "sale.order" model
View error context:
{'file': '/var/lib/odoo/.local/share/Odoo/addons/15.0/oa_basic_inherit/views/basic_inherit_view.xml',
'line': 3,
'name': 'sale.order.form',
'view': ir.ui.view(4106,),
'view.model': 'sale.order',
'view.parent': ir.ui.view(1091,),
'xmlid': 'view_order_form'}
And that my code, I cant figure out my mistake.
from odoo import api, fields, models
class SaleOrder(models.Model):
_inherit = "sale.order"
test= fields.Selection([('a','A'),('b','B'),('c','C')], string='Choose')
xml version="1.0" encoding="utf-8"?>
id="view_order_form" model="ir.ui.view">
name="name">sale.order.form
name="model">sale.order
name="inherit_id" ref="sale.view_order_form">
name="arch" type="xml">
expr="//field[@name='payment_term_id']" position="after">
name="test"/>