skip the inactivate employee in leaves summary
authorJoshuaJan <popkar77@gmail.com>
Sun, 6 Jul 2014 09:41:07 +0000 (17:41 +0800)
committerJoshuaJan <popkar77@gmail.com>
Sun, 6 Jul 2014 09:41:07 +0000 (17:41 +0800)
addons/hr_holidays/report/holidays_summary_report.py

index 36087a5..3f3a93d 100644 (file)
@@ -223,9 +223,7 @@ class report_custom(report_rml):
         elif data['model']=='ir.ui.menu':
             for id in data['form']['depts']:
                 dept = obj_dept.browse(cr, uid, id, context=context)
-                cr.execute("""SELECT id FROM hr_employee \
-                WHERE department_id = %s""", (id,))
-                emp_ids = [x[0] for x in cr.fetchall()]
+                emp_ids = obj_emp.search(cr, uid, [('department_id', '=', id)])
                 if emp_ids==[]:
                     continue
                 dept_done=0