This question has been flagged

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




Avatar
Discard
Best Answer

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


Avatar
Discard
Author Best Answer

Is there anyone who solved it ?

Thanks in advance

Avatar
Discard