[FIX]hr : inactive user should not display in subordinates list
bzr revid: hmo@tinyerp.com-20091027110606-61krrbhqkbjiyqg7
This commit is contained in:
@@ -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:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
Reference in New Issue
Block a user