Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1788 Lượt xem

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

 


Ảnh đại diện
Huỷ bỏ

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

Tác giả Câu trả lời hay nhất

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


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 1 24
3137
1
thg 3 24
1642
2
thg 9 25
1340
4
thg 9 25
6365
0
thg 8 25
630