diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 2704ec987f3..58f2357d452 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -153,7 +153,7 @@ class account_analytic_account(osv.osv): } def check_recursion(self, cr, uid, ids, parent=None): - return super(account_analytic_account, self).check_recursion(cr, uid, ids, parent=parent) + return super(account_analytic_account, self)._check_recursion(cr, uid, ids, parent=parent) _order = 'date_start desc,parent_id desc,code' _constraints = [ diff --git a/addons/crm_profiling/crm_profiling.py b/addons/crm_profiling/crm_profiling.py index 86cd41c0335..e5165f5b186 100644 --- a/addons/crm_profiling/crm_profiling.py +++ b/addons/crm_profiling/crm_profiling.py @@ -266,7 +266,7 @@ class crm_segmentation(osv.osv): } _constraints = [ - (orm.orm.check_recursion, 'Error ! You can not create recursive profiles.', ['parent_id']) + (orm.orm._check_recursion, 'Error ! You can not create recursive profiles.', ['parent_id']) ] def process_continue(self, cr, uid, ids, start=False): diff --git a/addons/event/event.py b/addons/event/event.py index ab90fe64803..db58971fd7c 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -247,17 +247,7 @@ class event_event(osv.osv): } def _check_recursion(self, cr, uid, ids): - """ - Checks for recursion level for event - """ - level = 100 - while len(ids): - cr.execute('SELECT DISTINCT parent_id FROM event_event WHERE id IN %s', (tuple(ids),)) - ids = filter(None, map(lambda x: x[0], cr.fetchall())) - if not level: - return False - level -= 1 - return True + return super(event_event, self)._check_recursion(self, cr, uid, ids) def _check_closing_date(self, cr, uid, ids): for event in self.browse(cr, uid, ids):