[FIX] hr_holidays: holidays report by department shows inactive employees
authorRifakat (OpenERP) <rha@tinyerp.com>
Fri, 26 Aug 2011 05:39:56 +0000 (11:09 +0530)
committerRifakat (OpenERP) <rha@tinyerp.com>
Fri, 26 Aug 2011 05:39:56 +0000 (11:09 +0530)
lp bug: https://launchpad.net/bugs/832569 fixed

bzr revid: rha@tinyerp.com-20110826053956-8dit0fbieob7pb3b

addons/hr_holidays/report/holidays_summary_report.py

index dd0bd91..7bc8894 100644 (file)
@@ -216,10 +216,8 @@ 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()]
-                if emp_ids==[]:
+                emp_ids = obj_emp.search(cr, uid, [('department_id','=',id)], context=context)
+                if not emp_ids:
                     continue
                 dept_done=0
                 for item in obj_emp.read(cr, uid, emp_ids, ['id', 'name']):