[IMP] orm: proper test for column names in check_recursion()

bzr revid: odo@openerp.com-20101123125638-dhd95d6a6xg912ls
This commit is contained in:
Olivier Dony 2010-11-23 13:56:38 +01:00
parent c8f52b8c98
commit 5d09bce920
1 changed files with 2 additions and 1 deletions

View File

@ -4222,7 +4222,8 @@ class orm(orm_template):
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 '')
assert parent is None or parent in self._columns or parent in self._inherit_fields,\
"The 'parent' parameter passed to check_recursion() must be None or a valid field name"
return self._check_recursion(cr, uid, ids, parent)
def _check_recursion(self, cr, uid, ids, parent=None):