Hello Bhushan,
With the change you suggested, it reported a new error now.
OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
at handleError (http://localhost:8099/web/assets/616cff4/web.assets_web.min.js:916:101)
at App.handleError (http://localhost:8099/web/assets/616cff4/web.assets_web.min.js:1542:29)
at ComponentNode.initiateRender (http://localhost:8099/web/assets/616cff4/web.assets_web.min.js:1006:19)
Caused by: Error: "mrp.workcenter"."equipment_ids" field is undefined.
at Field.parseFieldNode (http://localhost:8099/web/assets/616cff4/web.assets_web.min.js:7668:231)
My code:
class MrpWorkcenter(models.Model):
_inherit = 'mrp.workcenter'
_inherit = ['mail.thread',
'mail.activity.mixin',
] # add a chatter
equipment_ids = fields.One2many('maintenance.equipment', 'workcenter_id', string='Equipment', copy=True)
class MaintenanceEquipment(models.Model):
_inherit = 'maintenance.equipment'
workcenter_id = fields.Many2one('mrp.workcenter', string='Work Center', ondelete='cascade')
name = fields.Char('Equipment Name', required=False, translate=True)
I then tried to change code as follows. when upgrading the module from UI, the error became
File "C:\Odoo_code\elw\odoo\models.py", line 132, in raise_on_invalid_object_name
raise ValueError(msg)
ValueError: The _name attribute MrpWorkcenter is not valid.
class MrpWorkcenter(models.Model):
_inherit = ['mail.thread',
'mail.activity.mixin',
] # add a chatter
class MrpWorkcenter1(models.Model):
_inherit = 'mrp.workcenter'