[ADD] added comment in _validate() explaining why the context is not passed around when calling _constraints functions.

bzr revid: vmt@openerp.com-20121205082840-2ww34gbs7nl56952
This commit is contained in:
Vo Minh Thu 2012-12-05 09:28:40 +01:00
parent aec7ff5024
commit 93ae934963
1 changed files with 2 additions and 0 deletions

View File

@ -1524,6 +1524,8 @@ class BaseModel(object):
error_msgs = []
for constraint in self._constraints:
fun, msg, fields = constraint
# We don't pass around the context here: validation code
# must always yield the same results.
if not fun(self, cr, uid, ids):
# Check presence of __call__ directly instead of using
# callable() because it will be deprecated as of Python 3.0