[IMP] hr_holidays: add domain on active time off

Add a domain to only count active holiday allocations on the employee's
profile.

TaskID: 2048672

closes odoo/odoo#35547

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Kevin Baptiste
2019-08-08 06:43:24 +00:00
parent 68a13c99fd
commit 0b25547fc6
+2 -1
View File
@@ -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),