analytic, event, crm_profiling: use new _check_recursion() from ORM
bzr revid: p_christ@hol.gr-20101127201532-0ybt027d05qt52rp
This commit is contained in:
parent
6aa18c41c7
commit
dbcf9f404a
|
@ -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 = [
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue