~openerp-dev/openobject-server/saas-3-bug_1291322-ptr

« back to all changes in this revision

Viewing changes to openerp/service/model.py

  • Committer: Thibault Delavallée
  • Date: 2014-05-07 11:06:37 UTC
  • Revision ID: tde@openerp.com-20140507110637-qlj1rj8lrcpkejf6
[FIX] service: wrapper: fixed context fetching. Indeed call_kw set its context
in kwargs of kwargs, leading to a kwargception.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
                if args and isinstance(args[-1], dict):
55
55
                    ctx = args[-1]
56
56
            elif isinstance(kwargs, dict):
57
 
                ctx = kwargs.get('context', {})
 
57
                # kwargception because call_kw set its context in kwargs['kwargs']
 
58
                ctx = kwargs.get('context', kwargs.get('kwargs', {}).get('context', {}))
58
59
 
59
60
            uid = 1
60
61
            if args and isinstance(args[0], (long, int)):