تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
1516 أدوات العرض

i have modified res.users with field supervisor (many2one of res.users) using custom module.

now i want users of CRM Leads and Contacts to access as below:

1) user can view his or her record only

2) and a supervisor can see his record only and all of his suordinates records

how i can add a record rule for above mentioned

i tried something like below for both but not working... what i am doing wrong or missing something?

['|', '|',  ('user_id', '=', user.id),('user_id', '=', False), ('user_id.user_ids.supervisor', '=', user.id)]

AND - OR

how i can create same types record rules to restrict as above mentioned but instead of supervisor what if I want to use Manager which marked in Employee?

please help.

regards

الصورة الرمزية
إهمال
الكاتب

thanks a bunch @Chros TRINGHAM, i was searching but don't know how i lost my own thread where @Savya Sachin already Answered for it. now I will write whole thing in my notepad file to search it first.
thanks again.

أفضل إجابة

Hi,

Navigate to Technical > Security > Record Rules.
Create a new record rule for each scenario (Supervisor and Manager).

You can add the following code  for Managers can view the records of their subordinates['|',  ('user_id', '=', user.id),   ('user_id.employee_ids.parent_id', '=', user.id) ]

Hope it helps,

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أبريل 25
2659
1
مارس 25
2401
4
أغسطس 24
3829
0
مارس 24
1459
1
يناير 24
3538