summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMustufa Rangwala <mra@mra-laptop>2010-08-12 11:32:33 +0530
committerMustufa Rangwala <mra@mra-laptop>2010-08-12 11:32:33 +0530
commit4f8144b83ae4e96fb2101df2ca36eb52edb35001 (patch)
treebbf0e5daed56c4028bb6c24886a4f09134d3a7c8
parentcf50bdfc74fafcc06f2ea2cd9c160601f8750897 (diff)
[FIX] hr: check recursion on parent of employee
bzr revid: mra@mra-laptop-20100812060233-9zth4mqxpa0a9ewy
-rw-r--r--addons/hr/hr.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/addons/hr/hr.py b/addons/hr/hr.py
index f25383f3503..fcd6d57148d 100644
--- a/addons/hr/hr.py
+++ b/addons/hr/hr.py
@@ -148,11 +148,9 @@ class hr_employee(osv.osv):
}
def _check_recursion(self, cr, uid, ids, context=None):
- if context is None:
- context = {}
level = 100
while len(ids):
- cr.execute('select distinct parent_id from hr_employee where id IN %s',(tuple(ids),))
+ cr.execute('SELECT DISTINCT parent_id FROM hr_employee WHERE id IN %s AND parent_id!=id',(tuple(ids),))
ids = filter(None, map(lambda x:x[0], cr.fetchall()))
if not level:
return False