diff options
| author | Mustufa Rangwala <mra@mra-laptop> | 2010-08-12 11:02:52 +0530 |
|---|---|---|
| committer | Mustufa Rangwala <mra@mra-laptop> | 2010-08-12 11:02:52 +0530 |
| commit | cf50bdfc74fafcc06f2ea2cd9c160601f8750897 (patch) | |
| tree | 60a95b4bcc1ee8e994b3d5ae038b22668d6d06fc /addons | |
| parent | 53896bf7b693681e1c9694111bb7baf0b5c8790b (diff) | |
[FIX] hr: Parent compute on user
bzr revid: mra@mra-laptop-20100812053252-odbpsj7jh07ackb3
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/hr/hr_department.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/hr/hr_department.py b/addons/hr/hr_department.py index 0a139a90b3e..0bc0b56d42d 100644 --- a/addons/hr/hr_department.py +++ b/addons/hr/hr_department.py @@ -120,8 +120,10 @@ class res_users(osv.osv): obj_dept = self.pool.get('hr.department') for user_id in ids: emp_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id', '=', user_id)]) - cr.execute('SELECT emp.department_id FROM hr_employee AS emp JOIN resource_resource AS res ON res.id = emp.resource_id \ - WHERE res.user_id = %s AND emp.department_id IS NOT NULL', (user_id,)) + cr.execute('SELECT emp.department_id FROM hr_employee AS emp \ + JOIN resource_resource AS res ON res.id = emp.resource_id \ + JOIN hr_department as dept ON dept.id = emp.department_id \ + WHERE res.user_id = %s AND emp.department_id IS NOT NULL AND dept.manager_id IS NOT NULL', (user_id,)) ids_dept = [x[0] for x in cr.fetchall()] # ids_dept = obj_dept.search(cr, uid, [('member_ids', 'in', [user_id])], context=context) parent_ids = [] |
