Skip to content
Permalink
Browse files

[IMP] hr_holiday: Don't check access rights on allocation if no employee

If there are no employee set on the allocation request and if the user
is a leave officer, don't check the access rights as it would lead to
a traceback.
  • Loading branch information...
tivisse committed Mar 14, 2019
1 parent c8266ba commit 1369e2173a00cffeb2045a9551f7b27a56b88eff
Showing with 2 additions and 0 deletions.
  1. +2 −0 addons/hr_holidays/models/hr_leave_allocation.py
@@ -486,6 +486,8 @@ def action_refuse(self):
def _check_approval_update(self, state):
""" Check if target state is achievable. """
current_employee = self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1)
if not current_employee:
return
is_officer = self.env.user.has_group('hr_holidays.group_hr_holidays_user')
is_manager = self.env.user.has_group('hr_holidays.group_hr_holidays_manager')
for holiday in self:

0 comments on commit 1369e21

Please sign in to comment.
You can’t perform that action at this time.