Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
6202 Lượt xem

Hello Everyone


I try to make some access rights on calendar event views (in ir.rule) but it doesn't work. I wanted that each salesman can see only the events created by himself or the one in which he is among the attendees, so I did this :

<record id="calendar_event_rule_salesman" model="ir.rule">
<field name="name">Own events salesman</field>
<field ref="model_calendar_event" name="model_id"/>
<field name="domain_force">['|',('partner_ids','in',user.partner_id.id),('user_id','=',user.id)]</field>
<field name="groups" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
</record>

Unfortunately, it doesn't work and salesman still can check everyone calendar to see the events of everyone


I appreciate your support




Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hi Othmane Ghandi,

I believe I have found the answer to your question.

1. Make 2 Record Rules, the first Record Rules is for administrators/managers who can see all other people's events. The second record rules is only for your individual sales.

2. Paste the following  for each record rules :
1st record rules  [(1,'=',1)]
2nd record rules ['|',('partner_ids','in',user.partner_id.id),('user_id','=',user.id)]

3. Make 2 Groups, the first Group is for administrators/managers who can see all other people's events. The second group is only for your individual sales.

4. Assign The 1st record rules to the 1st group, and the 2nd record rules to the 2nd group.

5. FInally, assign the 1st group to your manager in "users" and assign the 2nd group to your sales in "users"

Done! Hope it helps


Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Is there anyone who solved it ?

Thanks in advance

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 16
2990
1
thg 8 20
2528
0
thg 11 17
4493
0
thg 6 25
761
2
thg 9 23
26694