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

Hi mates,

I'm trying to create a custom res.config.settings but I need more insights, let me explain my case. I want to save in my custom config settings, 2 type of users (users that belongs to "maintenance" group users nor "reviewers" group users)

class ResConfigSettings(models.TransientModel):
    _inherit='res.config.settings'
    type_1_user_ids = fields.One2many('res.users', ... domain=lambda self:[('groups_id','=',self.env.ref('mygroup'))])
    type2_user_ids = fields.One2many ...

The thing is that,  I cannot declare the field of the inverse Many2one field in comodel_name because Many2One relationships from non-transient Model (res.users) to TransientModel (res.config.settings) are forbidden.

How can I achieve this?

아바타
취소
작성자 베스트 답변

FYI, i solved this by using many2many fields instead of one2many. The only thing you have to keep in mind is to use different relational database tables for both m2m fields.

아바타
취소
관련 게시물 답글 화면 활동
2
11월 19
3611
1
9월 23
3987
1
3월 23
2639
3
1월 23
6405
2
1월 23
951