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

Hello,

I'm working with Odoo 17 i created 2 groups 1 for the team leaders of the crm.team (Chef Equipe) and the other one for the members of the crm.team (Membre Equipe Commerciale), then i added a record rule for each group on the model Contact so the team leaders can see the contacts created by them and the contacts created by their team members.

This is the record rule for the group Chef Equipe (Team leaders) :

['|', ('team_id.user_id', '=', user.id), ('user_id', 'in', user.team_id.member_ids.ids)]

This is the record rule for the group Membre Equipe Commerciale (Team members) :

[('user_id', 'in', user.team_id.member_ids.ids)]

when i activate the 2nd rule i can't login in odoo using the team members account, i keep getting this error :



so i archived it, and when i login with a team leader account i can see the contacts records in the list / kanban view but when i try to open any record i get this error :



How can i fix them ?

Thank you.

아바타
취소
베스트 답변

Hi,

Team Leaders rule:

['|',

    ('user_id', '=', False),

    '|',

        ('team_id.user_id', '=', user.id),

        ('user_id', 'in', user.team_id.member_ids.ids)

]


Team Members rule:

['|',

    ('user_id', '=', False),

    ('user_id', 'in', user.team_id.member_ids.ids)

]


Hope it helps.

아바타
취소
베스트 답변

Hello Houssem Jabally,

I hope you are doing well,

​Please try these below condition:

Modify the Record Rule for Team Members
​['|', ('user_id', '=', user.id), ('user_id', 'in', user.team_id.member_ids.ids)]


Thanks & Regards,
Kunjan Patel

아바타
취소
베스트 답변

The Odoo res.users model inherits the res.partner model (Contact). So your new record rule prevents accessing the user-linked contact. You need to bypass the restriction using an extra condition in the record rule. It is better to avoid the record rule for contacts linked with users.

아바타
취소
작성자

Which extra condition should i add ?

관련 게시물 답글 화면 활동
0
4월 22
2472
1
7월 24
1769
1
2월 23
2278
2
9월 25
3044
0
7월 24
4