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

i want the user to be access planning slot for the related employee 
and all employees that he is Their manager,
so the employee can access his planning, also his manager and his manager ect. can access all child employee planning.
thanks
 

Awatar
Odrzuć
Najlepsza odpowiedź

In Odoo, achieving access to planning slots for employees based on their managerial hierarchy involves configuring access control rules and defining appropriate permissions. You can accomplish this using Odoo's security settings and access control mechanisms. Here's a step-by-step approach:

1. Set Up User Roles:
  • Create distinct user roles such as "Employee" and "Manager."
2. Define Access Control Groups:
  • Assign employees to their respective user roles (Employee or Manager).
3. Configure Access Control Rules:
  • Go to Settings > Technical > Security > Record Rules.
  • Create record rules to define access permissions based on the hierarchical structure.
  • For example, for the "Employee" role:
    • Allow access to their own planning slots.
  • For the "Manager" role:
    • Allow access to planning slots of employees directly reporting to them or any subordinate employees.
4. Implement Hierarchical Relationships:
  • In the Employee module, set the reporting hierarchy for each employee.
  • Ensure that each employee has a manager defined.
5. Apply Record Rules:
  • Associate the record rules you created with the respective Employee Planning module or any relevant module where planning slots are managed.
6. Testing and Validation:
  • Test the setup by logging in as different users (employee and manager profiles) to confirm access rights.
  • Managers should have access to their own planning slots and those of employees reporting to them.

Example of Record Rules (Python-like Odoo domain syntax):

For Managers:

[(1, '=', 1)]  # Allow access to all records

For Employees:

['|', ('employee_id.user_id', '=', user.id), ('employee_id.parent_id.user_id', '=', user.id)]  

# Allow access to their own records and records of employees reporting to them

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
sie 25
165
1
sie 25
2123
1
lip 25
2593
2
lip 25
8034
2
lip 25
4489