Skip to content

Commit

Permalink
Merge PR #116 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Sep 30, 2024
2 parents 0677b1c + 9726640 commit f81ecc6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions hr_holidays_public/models/hr_leave.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,16 @@ def action_validate(self):
holiday. Unfortunately, no regression test can be added, being in a separate
module.
"""
if self.holiday_status_id.exclude_public_holidays or not self.holiday_status_id:
self = self.with_context(
employee_id=self.employee_id.id, exclude_public_holidays=True
)
return super().action_validate()
for leave in self:
if (
leave.holiday_status_id.exclude_public_holidays
or not leave.holiday_status_id
):
leave = leave.with_context(
employee_id=leave.employee_id.id, exclude_public_holidays=True
)
super(HrLeave, leave).action_validate()
return True

def _get_duration(self, check_leave_type=True, resource_calendar=None):
if self.holiday_status_id.exclude_public_holidays or not self.holiday_status_id:
Expand Down

0 comments on commit f81ecc6

Please sign in to comment.