From 863f0d003f5b46d10c155ed253b83b0567da1f22 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Tue, 13 Sep 2011 16:47:02 +0200 Subject: [PATCH] [FIX] orm: avoid passing undefined context in browse_record getattr() bzr revid: odo@openerp.com-20110913144702-7g56odiorqdiea28 --- openerp/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index b721e814aa3..7efe2272754 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -328,7 +328,7 @@ class browse_record(object): attr = getattr(self._table, name) if isinstance(attr, (types.MethodType, types.LambdaType, types.FunctionType)): def function_proxy(*args, **kwargs): - if 'context' not in kwargs: + if 'context' not in kwargs and self._context: kwargs.update(context=self._context) return attr(self._cr, self._uid, [self._id], *args, **kwargs) return function_proxy