From: Thibault Delavallée Date: Wed, 7 May 2014 11:06:37 +0000 (+0200) Subject: [FIX] service: wrapper: fixed context fetching. Indeed call_kw set its context X-Git-Tag: InsPy_master01~40^2~9^2~2 X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=0f9917c9a3245aa21efc427d3d7a7b1402c92c37;p=odoo%2Fodoo.git [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 --- diff --git a/openerp/service/model.py b/openerp/service/model.py index d65cbd7..2bbba4e 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)):