From 1a42387a2c91fdc07ec98a51583a17c7860da72c Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Tue, 27 Oct 2009 16:36:06 +0530 Subject: [PATCH] [FIX]hr : inactive user should not display in subordinates list bzr revid: hmo@tinyerp.com-20091027110606-61krrbhqkbjiyqg7 --- addons/hr/hr_department.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/hr/hr_department.py b/addons/hr/hr_department.py index 7c7c812d823..8c424fab8a6 100644 --- a/addons/hr/hr_department.py +++ b/addons/hr/hr_department.py @@ -109,6 +109,7 @@ class res_users(osv.osv): def _child_compute(self, cr, uid, ids, name, args, context={}): obj_dept = self.pool.get('hr.department') + obj_user = self.pool.get('res.users') result = {} for manager_id in ids: child_ids = [] @@ -116,8 +117,9 @@ class res_users(osv.osv): ids_dept = obj_dept.search(cr, uid, [('id', 'child_of', mgnt_dept_ids)]) if ids_dept: data_dept = obj_dept.read(cr, uid, ids_dept, ['member_ids']) - childs = map(lambda x: x['member_ids'], data_dept) + childs = map(lambda x: x['member_ids'], data_dept) childs = tools.flatten(childs) + childs = obj_user.search(cr, uid, [('id','in',childs),('active','=',True)]) if manager_id in childs: childs.remove(manager_id) @@ -148,4 +150,4 @@ class res_users(osv.osv): res_users() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: