[FIX] hr_holidays: fix leaves count domain

In active leave types should not be considered.

closes odoo/odoo#34475

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Cas Vissers
2019-07-01 09:04:37 +00:00
parent 53ef25284f
commit 467ac9843d
+1
View File
@@ -146,6 +146,7 @@ class Employee(models.Model):
all_leaves = self.env['hr.leave.report'].read_group([
('employee_id', 'in', self.ids),
('holiday_status_id.allocation_type', '!=', 'no'),
('holiday_status_id.active', '=', 'True'),
('state', '=', 'validate')
], fields=['number_of_days', 'employee_id'], groupby=['employee_id'])
mapping = dict([(leave['employee_id'][0], leave['number_of_days']) for leave in all_leaves])