コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
6201 ビュー

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
2989
1
8月 20
2528
0
11月 17
4492
0
6月 25
761
2
9月 23
26690