跳至內容
選單
此問題已被標幟
1 回覆
1482 瀏覽次數

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',]

 


頭像
捨棄

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

作者 最佳答案

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']


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
1月 24
2677
1
3月 24
1322
4
5月 25
2408
2
5月 25
5744
1
3月 25
1599