← Back to team overview

openerp-community team mailing list archive

lp:~openerp-community/openobject-server/stefan-therp_lp891592-6.1 into lp:openobject-server

 

Stefan Rijnhart (Therp) has proposed merging lp:~openerp-community/openobject-server/stefan-therp_lp891592-6.1 into lp:openobject-server.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #891592 in OpenERP Server: "Context not passed to _constraints functions"
  https://bugs.launchpad.net/openobject-server/+bug/891592

For more details, see:
https://code.launchpad.net/~openerp-community/openobject-server/stefan-therp_lp891592-6.1/+merge/82529

This branch passes the context to the _constraints functions on the model.

-- 
https://code.launchpad.net/~openerp-community/openobject-server/stefan-therp_lp891592-6.1/+merge/82529
Your team OpenERP Community is subscribed to branch lp:~openerp-community/openobject-server/stefan-therp_lp891592-6.1.
=== modified file 'openerp/osv/orm.py'
--- openerp/osv/orm.py	2011-11-16 11:38:58 +0000
+++ openerp/osv/orm.py	2011-11-17 13:09:19 +0000
@@ -1411,7 +1411,7 @@
         error_msgs = []
         for constraint in self._constraints:
             fun, msg, fields = constraint
-            if not fun(self, cr, uid, ids):
+            if not fun(self, cr, uid, ids, context):
                 # Check presence of __call__ directly instead of using
                 # callable() because it will be deprecated as of Python 3.0
                 if hasattr(msg, '__call__'):


Follow ups