This question has been flagged
1 Reply
7405 Views

I need to Approve Leaves of Employees, The number of managers/ids will vary from one employee to another Example: Many Departments in a company will use its own path to approve leaves In Dep1, Emp1_1 and Emp1_2 will create Leave Request which will be approved by Manager1 and Manager2

In Dep2, Emp2_1 and Emp2_2 will create Leave Request which will be approved by Manager1, Manager2, Manager3

Avatar
Discard
Best Answer

The leave approval process in the hr_holidays module is a pretty basic one. An employee's leave can only be approved by a user in the HR Officer group (or higher). So, if you want to involve the employee's manager in the process you can either: 1) Give the manager HR Officer access or 2) Create your own (fairly sophisticated) module to override the default workflow

My "very rough" outline for how #2 would work:

  1. Create a separate group called group_department_manager
  2. Attach this group to the appropriate workflow transition
  3. Add all department managers to this group
  4. Modify 'ir.model.access' rules restricting access to 'hr.holidays'
  5. Create 'ir.rule' object for 'hr.holidays' that would allow a user to only read/write records for users that are under him in the employee hierarchy :P
Avatar
Discard