Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2768 มุมมอง

Hi,

Hr manager can access only his department(D1) employees. For this i have created a new ir.rule,

<record model="ir.rule" id="hr_manager_employee_rule">
<field name="name">HR Manager only view his department's employee</field>
<field name="model_id" ref="model_hr_employee"/>
<field name="groups" eval="[(6,0, [ref('group_hr_manager')])]"/>
<field name="domain_force">[('department_id', 'in', [user.employee_ids.department_id.id])]
</field>
</record>

I assigned demo user as hr manager. Now i can view only the employees in his department D1.

Then i have changed his department to D2 and checked, but now there is no change.

I can view employees from D1 and can't view employees of D2. Then i restarted my odoo and its working.

After changing department of employee i need to restart odoo to get the employee list updated.


Is there is any solution for this ?


Thanks in advance


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

https://www.odoo.com/fr_FR/forum/aide-1/question/record-rule-domain-changes-not-applied-unless-server-is-restarted-119366

Hope this will help you !

อวตาร
ละทิ้ง
ผู้เขียน

It's working. Thank You..

Related Posts ตอบกลับ มุมมอง กิจกรรม
5
ธ.ค. 19
11371
4
ม.ค. 19
4392
1
ม.ค. 19
7603
[SOLVED] Invisible Button After Clicked แก้ไขแล้ว
2
ม.ค. 19
10209
7
ก.พ. 18
3746