From bd2a74474bec88a4bf818a5bb40300c1284e658e Mon Sep 17 00:00:00 2001 From: Jay Vora Date: Fri, 29 Aug 2008 11:36:26 +0530 Subject: [PATCH] Commented Errorneous code of checking recursion. bzr revid: jvo@tinyerp.com-20080829060626-eabyjc7k6ctvd5g7 --- addons/account/account.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 34b421c7e6f..a27732d5f57 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1667,19 +1667,19 @@ class account_account_template(osv.osv): 'type' : lambda *a :'view', } - def _check_recursion(self, cr, uid, ids): - level = 100 - while len(ids): - cr.execute('select distinct parent_id from account_account_template_rel where child_id in ('+','.join(map(str,ids))+')') - ids = filter(None, map(lambda x:x[0], cr.fetchall())) - if not level: - return False - level -= 1 - return True - - _constraints = [ - (_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id']) - ] +# def _check_recursion(self, cr, uid, ids): +# level = 100 +# while len(ids): +# cr.execute('select distinct parent_id from account_account_template_rel where child_id in ('+','.join(map(str,ids))+')') +# ids = filter(None, map(lambda x:x[0], cr.fetchall())) +# if not level: +# return False +# level -= 1 +# return True +# +# _constraints = [ +# (_check_recursion, 'Error ! You can not create recursive accounts.', ['parent_id']) +# ] def name_get(self, cr, uid, ids, context={}):