From 93ae934963bf4b2e7e2e0a242bb7dd4755d3d557 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 5 Dec 2012 09:28:40 +0100 Subject: [PATCH] [ADD] added comment in _validate() explaining why the context is not passed around when calling _constraints functions. bzr revid: vmt@openerp.com-20121205082840-2ww34gbs7nl56952 --- openerp/osv/orm.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 110012bbc07..ef13253864b 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -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