From 08ef1a95f1d60df8fb777b9022b17fc6091b274e Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Tue, 16 Nov 2010 17:04:35 +0200 Subject: [PATCH] ORM: deprecate check_recursion() in favour of _check_recursion() bzr revid: p_christ@hol.gr-20101116150435-jfmjah8ookf11x3y --- bin/osv/orm.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 0d37f5afc15..d7b406c0f3d 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -4214,6 +4214,12 @@ class orm(orm_template): return cr.fetchone()[0] == len(ids) def check_recursion(self, cr, uid, ids, parent=None): + warnings.warn("You are using deprecated %s.check_recursion(). Please use the '_check_recursion()' instead!" % \ + self._name, DeprecationWarning, stacklevel=3) + assert ' ' not in (parent or '') + return self._check_recursion(cr, uid, ids, parent) + + def _check_recursion(self, cr, uid, ids, parent=None): """ Verifies that there is no loop in a hierarchical structure of records, by following the parent relationship using the **parent** field until a loop