Odoo Help


Leave approval workflow OpenERPv7

Noel Nuguid
on 3/13/13, 2:46 AM 6,056 views

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?

Mike Telahun
On 3/19/13, 9:11 AM

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

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

Hussain Behestee
on 6/18/13, 4:27 AM

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...!

Paul Strinati
on 5/6/14, 2:34 PM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)


Asked: 3/13/13, 2:46 AM
Seen: 6056 times
Last updated: 5/18/16, 5:48 AM