Skip to content
Snippets Groups Projects
Commit 0854320e authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[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
parent 75b99324
No related branches found
No related tags found
No related merge requests found
......@@ -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
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment