Good day everyone,
usind this code I've added a related custom field inheriting a odoo module repair.order and is working fine and the field is properly added to the table in the database.
class RepairOder(models.Model):
_inherit = 'repair.order'
sale_order_name = fields.Char(related='service_sale_order_id.name', copy=False, readonly=True, store=True)
Then using this code added a related custom field inheriting repar.fee to point to repair.order custom field
class RepairFee(models.Model):
_inherit = 'repair.fee'
so_name = fields.Char(related='repair_id.sale_order_name',readonly=True,store=True)
but it always throws the following error.
self._setup_related_full(model)
File "/odoo13c/odoo13c-server/odoo/fields.py", line 486, in _setup_related_full
field = target._fields[name]
KeyError: 'sale_order_name'
Any idea what could b wrong with this code? thanks in advance