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

Hi there, I am working on a custom module that inherits "res.partner" from "purchase" module.

When the customer requested the mail thread and mail activity functionality, I inherited them as well such as that:

_inherit = ["res.partner", "mail.thread", "mail.activity.mixin"]


It failed to read from the database, so I simplified this to be:

_inherit = ["res.partner", "mail.thread",]


, and I found this duplication error:

TypeError: Many2many fields res_partner.category_id and res.partner.category_id use the same table and columns


So, are there any suggestions to inherit safely from multiple modules?

By the way I know about delegation, and I can combine it with classical inheritance. Do I need to solve it without delegation if possible?


* Maybe this means that MailThread is already previously imported.

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi 


Try this code

_inherits = {'res.partner': 'partner_id'}
_inherit = ['mail.thread', 'mail.activity.mixin']

partner_id = fields.Many2one('res.partner', string='Partner',)


Regards

อวตาร
ละทิ้ง
ผู้เขียน

Thanks a lot, sorry for delay as I had to participate in an odoo course to get more karma in order to be able to say <"thank-you">

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
ก.ค. 23
3183
0
พ.ค. 15
7425
0
พ.ย. 20
3938
1
ธ.ค. 19
5835
1
มี.ค. 16
10716