From 0f9917c9a3245aa21efc427d3d7a7b1402c92c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 7 May 2014 13:06:37 +0200 Subject: [PATCH] [FIX] service: wrapper: fixed context fetching. Indeed call_kw set its context in kwargs of kwargs, leading to a kwargception. bzr revid: tde@openerp.com-20140507110637-qlj1rj8lrcpkejf6 --- openerp/service/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openerp/service/model.py b/openerp/service/model.py index d65cbd77333..2bbba4ef72a 100644 --- a/openerp/service/model.py +++ b/openerp/service/model.py @@ -54,7 +54,8 @@ def check(f): if args and isinstance(args[-1], dict): ctx = args[-1] elif isinstance(kwargs, dict): - ctx = kwargs.get('context', {}) + # kwargception because call_kw set its context in kwargs['kwargs'] + ctx = kwargs.get('context', kwargs.get('kwargs', {}).get('context', {})) uid = 1 if args and isinstance(args[0], (long, int)):