Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
1488 Ansichten

Dear helpers,

I am using v17 and facing below issue and have no clue to resolve it. I have to comment the second 'inherit'.


Error: ValueError: The _name attribute MrpWorkcenter is not valid.

code:

class MrpWorkcenter(models.Model):
_inherit = 'mrp.workcenter'
_inherit = [ 'mail.thread',
'mail.activity.mixin',
] # add a chatter

if I set the following, the ERROR becomes 

TypeError: Many2many fields MrpWorkcenter1.alternative_workcenter_ids and mrp.workcenter.alternative_workcenter_ids use the same table and columns

_inherit = ['mrp.workcenter', 'mail.thread', 'mail.activity.mixin',]

 


Avatar
Verwerfen

It seems you are inherting wrong. try _inherit = ['mrp.workcenter', 'mail.thread', 'mail.activity.mixin']

Autor Beste Antwort

Hi,

I figured out the inherit way is wrong.

below way works 

class MrpWorkcenter(models.Model):
_name = 'mrp.workcenter'
_inherit = ['mrp.workcenter', 'mail.thread', 'mail.activity.mixin']


Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
3
Jan. 24
2686
1
März 24
1323
4
Mai 25
2427
2
Mai 25
5757
1
März 25
1610