콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2118 화면

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">

관련 게시물 답글 화면 활동
2
7월 23
3152
0
5월 15
7367
0
11월 20
3910
1
12월 19
5810
1
3월 16
10686