Skip to content

Commit

Permalink
Bugfix [json-rpc] correctly parse response that results in None
Browse files Browse the repository at this point in the history
  • Loading branch information
katyukha committed Jun 6, 2016
1 parent e0a10b7 commit 5b4c72b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -6,6 +6,10 @@ Release 0.6.9.dev0

- ``external_ids`` plugin now adds ``Record.as_xmlid`` method
- bugfix: ensure thet record is present in cache on init of Record class
- bugfix: [json-rpc], if RPC method results in None, then there is no
'result' object in response, so if there are no 'error' object, nor 'result',
then suppose that 'result' is None, thus it is possible to deal with
Odoo methods, that returns None as result via RPC


Release 0.6.8
Expand Down
4 changes: 3 additions & 1 deletion openerp_proxy/connection/jsonrpc.py
Expand Up @@ -89,7 +89,9 @@ def __call__(self, *args):
raise JSONRPCError(error['message'],
code=error.get('code', None),
data=error.get('data', None))
return result["result"]
# if 'result' is not present in response object, then it seems, that
# result is None
return result.get("result", None)


class JSONRPCProxy(object):
Expand Down

0 comments on commit 5b4c72b

Please sign in to comment.