[FIX] HR : Better improvement of previous commit on the critical error of res_user search if non-admin user is related to an employee
bzr revid: jvo@tinyerp.com-20100826084008-5ikttnklrbkfxpez
This commit is contained in:
parent
dafba0d2ea
commit
7d9d528784
|
@ -130,8 +130,8 @@ class res_users(osv.osv):
|
|||
data_dept = obj_dept.read(cr, uid, ids_dept, ['manager_id'], context=context)
|
||||
parent_ids = map(lambda x: x['manager_id'][0], data_dept)
|
||||
cr.execute('SELECT res.user_id FROM hr_employee AS emp JOIN resource_resource AS res ON res.id=emp.resource_id \
|
||||
WHERE emp.id IN %s', (tuple(parent_ids),))
|
||||
parent_ids = [x[0] for x in cr.fetchall() if x[0]]
|
||||
WHERE emp.id IN %s AND res.user_id IS NOT NULL', (tuple(parent_ids),))
|
||||
parent_ids = [x[0] for x in cr.fetchall()]
|
||||
result[user_id] = parent_ids
|
||||
return result
|
||||
|
||||
|
|
Loading…
Reference in New Issue