Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
1559 มุมมอง

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


อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
v17: error while inheriting res.users แก้ไขแล้ว
3
ม.ค. 24
2721
1
มี.ค. 24
1354
4
พ.ค. 25
2513
2
พ.ค. 25
5877
1
มี.ค. 25
1693