Skip to Content
Menu
This question has been flagged
1 Reply
1088 Views

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
 

Avatar
Discard
Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
1
Jul 25
2466
2
Jul 25
7918
2
Jul 25
4337
2
Jul 25
4072
2
Jun 25
2668