From 0854320ec1dac6e6aa0e3d0a631684339859cd33 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 27 May 2015 10:19:25 +0200 Subject: [PATCH] [FIX] hr_holidays: leaves_count on stat button only counts type 'remove' The stat button 'Leaves' on the employee's form view displays the total number of leaves (including holidays allocations and leave requests). When the button is clicked, only leave requests are show, which makes inconsistent the number displayed with the list of results. This fixes this behavior. opw-640349 --- addons/hr_holidays/hr_holidays.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 96040f64ba5..99319658392 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -559,7 +559,7 @@ class hr_employee(osv.osv): def _leaves_count(self, cr, uid, ids, field_name, arg, context=None): Holidays = self.pool['hr.holidays'] return { - employee_id: Holidays.search_count(cr,uid, [('employee_id', '=', employee_id)], context=context) + employee_id: Holidays.search_count(cr,uid, [('employee_id', '=', employee_id), ('type', '=', 'remove')], context=context) for employee_id in ids }