This question has been flagged

Hi I'm having a hard time trying to work out the permissions for the Human Resources module of OpenERPv7 when it comes to the Leave Management Workflow.

Let say I have a Department with the following employees:

Manager01 - Manager of the Department Employee01 - First Employee on the same department

I've initially set both Manager01 and Employee01 as Employee in the access rights for Human Resources. I also set Manager01 as Employee01's manager in the employee directory and set both persons in the same department. So the problem here is that if Employee01 submits a leave request, Manager01 wont be able to the request because the "Leave Requets to Approve" is not visible at the Employee access level.

Now, I tried upgrading the access right of Manager01 to HR Officer and Lo and Behold! He now have access to Employee01's leave request to approve or refuse as he deems fit.

But with Manager01 having HR office access rights, he can now do a lot more than approve leaves such as:

Create Applications (using the recruitment module) and ACTUALLY Hire the applicatant. Create payslips for the Employees Edit his own attendance entries.

I was underthe impression that the above privileges should not be given to department Manager.

Am missing a setting that I should be configuring?

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'
4. 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
Avatar
Discard

Can you please give the code here for domain? It will be a great help for me

Hi - I tried duplicating the HR/Office role (HR/Leave Approver), with the idea of removing Access Rights & Menu items from this new group until I have what I need to allow department managers to approve leave. However, before I even start removing Access Rights or Menus, my newly created HR/Leave Approver group is unable to approve leave requests (even though it is a duplicate of the HR/Officer group). Any idea what I have missed? How do you 'attach a group to a workflow transition', and which transition is the appropriate one? Sorry - am new to this...!