跳至内容
菜单
此问题已终结

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




形象
丢弃
最佳答案

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


形象
丢弃
编写者 最佳答案

Is there anyone who solved it ?

Thanks in advance

形象
丢弃
相关帖文 回复 查看 活动
0
11月 16
2968
1
8月 20
2500
0
11月 17
4472
0
6月 25
714
2
9月 23
26526