[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:
PSI(OpenERP) 2010-08-26 14:10:08 +05:30 committed by Jay (OpenERP)
parent dafba0d2ea
commit 7d9d528784
1 changed files with 2 additions and 2 deletions

View File

@ -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