Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
2789 Переглядів

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
11407
4
січ. 19
4398
1
січ. 19
7621
2
січ. 19
10234
7
лют. 18
3763