From aec13abc18d18668babfb06b71f7fbbacc631fe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Lef=C3=A8vre?= Date: Fri, 1 Mar 2019 15:30:39 +0100 Subject: [PATCH] [FIX] hr_holidays: Allow Team leader to approve Currently, a Team leader can't approve a leave of an employee in his team if the leave type requires an allocation. The reason is the `ir.rule` for `base.group_user` restricting allocation read access to only your own allocation (`[('employee_id.user_id', '=', user.id)]`) There are no `ir.rule` for group Team leader. Therefore, a team leader can't read allocations for his team members. Fix: add an `ir.rule` to allow a team leader to read allocations of employees in his team. + add associated tests --- addons/hr_holidays/tests/test_access_rights.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/tests/test_access_rights.py b/addons/hr_holidays/tests/test_access_rights.py index 00ac2856d20..f2ce950f235 100644 --- a/addons/hr_holidays/tests/test_access_rights.py +++ b/addons/hr_holidays/tests/test_access_rights.py @@ -368,7 +368,7 @@ class TestLeavesRights(TestHrHolidaysBase): @mute_logger('odoo.models.unlink', 'odoo.addons.mail.models.mail_mail') def test_leave_validation_team_leader_other(self): - """ Team Leader validates its employee's leave only""" + """ Team Leader validates its employee's allocations only""" self.leave_type.write({'allocation_type': 'fixed'}) self.env['hr.leave.allocation'].create({ 'holiday_status_id': self.leave_type.id, @@ -380,7 +380,7 @@ class TestLeavesRights(TestHrHolidaysBase): @mute_logger('odoo.models.unlink', 'odoo.addons.mail.models.mail_mail') def test_leave_validation_team_leader(self): - """ Team Leader validates its employee's leave""" + """ Team Leader validates its employee's allocations""" self.leave_type.write({'allocation_type': 'fixed'}) # set the team leader