diff --git a/addons/hr_holidays/models/hr.py b/addons/hr_holidays/models/hr.py index be5294d847a..68e20bb3420 100644 --- a/addons/hr_holidays/models/hr.py +++ b/addons/hr_holidays/models/hr.py @@ -116,7 +116,7 @@ class Employee(models.Model): ) h join hr_leave_type s ON (s.id=h.holiday_status_id) WHERE - h.state='validate' AND + s.active = true AND h.state='validate' AND (s.allocation_type='fixed' OR s.allocation_type='fixed_allocation') AND h.employee_id in %s GROUP BY h.employee_id""", (tuple(self.ids),)) @@ -135,6 +135,7 @@ class Employee(models.Model): for employee in self: allocations = self.env['hr.leave.allocation'].search([ ('employee_id', '=', employee.id), + ('holiday_status_id.active', '=', True), ('state', '=', 'validate'), '|', ('date_to', '=', False),