Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie

Hello.

I need help de edit the rule below:

I want to allow manager of parent parent department to see his employees and the employees who are in child departments.

Manager M oo Department A (DeptA) sees employees in Departmenents (DepA DepAA DepAAA..)

My version: odoo 15

thanks!

Awatar
Odrzuć
Najlepsza odpowiedź

Hi,


To achieve what you're describing—allowing a manager to see employees in their own department as well as in all child departments—you can configure a record rule on the hr.employee model using a domain filter based on the department hierarchy.

Steps to Configure the Rule in Odoo 15:


    Activate Developer Mode (if not already enabled).


    Navigate to Settings → Technical → Security → Record Rules.


    Create a new rule (or modify an existing one) with the following:


    Name: View Employees in Manager’s Department and Sub-Departments


    Object: hr.employee


    Domain Filter:


    python

    ['|', 

     ('department_id.id', 'child_of', user.employee_id.department_id.id),

     ('department_id.id', '=', user.employee_id.department_id.id)]


    This domain uses child_of, which is a special Odoo operator that includes the selected department and all of its children recursively.


    Assign the rule to the appropriate group (e.g., Manager or HR Manager), depending on who should have this visibilit


  This configuration should allow department managers to see employees in their own department and any sub-departments beneath it.


Hope it helps  

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
paź 20
3500
2
lis 24
1580
1
maj 24
2607
1
lis 22
4950
2
lip 22
3692