I am trying to create one field that can be accesses thru many odoo models, Here is the model code!
# -*- coding: utf-8 -*-
from odoo import models, fields
class code_adi(models.Model):
_inherit=['res.currency','res.partner','product.product']
_order='adi_code asc'
adi_code = fields.Char(string='Code')
_sql_constraints = [
('name_uniq_code', 'UNIQUE (adi_code)', 'Code must be unique.')
]
when i upgrade my module with an xml file that is empty it works for me, and i am able to see the added field in all inherited models, but once i start inheriting views and trying to access my field ('adi_code'), i get an error saying that my field does not exist.
Thanks