Skip to content
Snippets Groups Projects
Commit 4f8144b8 authored by Mustufa Rangwala's avatar Mustufa Rangwala
Browse files

[FIX] hr: check recursion on parent of employee

bzr revid: mra@mra-laptop-20100812060233-9zth4mqxpa0a9ewy
parent cf50bdfc
Branches
Tags
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment