From cadb1f877cc411b631808856e023d6bc69aab421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 24 May 2013 12:40:34 +0200 Subject: [PATCH] Use jsonrpc object_hook to load json from URL (transplanted from ead6182dfa926891e9a429363c23466de561b5f0) --- tryton/gui/main.py | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tryton/gui/main.py b/tryton/gui/main.py index fca3b2246c..dbadd2271b 100644 --- a/tryton/gui/main.py +++ b/tryton/gui/main.py @@ -19,6 +19,7 @@ from tryton.common import RPCExecute, RPCException from tryton.config import CONFIG, TRYTON_ICON, get_config_dir import tryton.common as common from tryton.pyson import PYSONDecoder +from tryton.jsonrpc import object_hook from tryton.action import Action from tryton.exceptions import TrytonServerError, TrytonError, \ TrytonServerUnavailable @@ -1574,9 +1575,12 @@ class Main(object): limit = json.loads(params.get('limit', 'null')) auto_refresh = json.loads(params.get('auto_refresh', 'false')) name = json.loads(params.get('window_name', 'false')) - search_value = json.loads(params.get('search_value', '{}')) - domain = json.loads(params.get('domain', '[]')) - context = json.loads(params.get('context', '{}')) + search_value = json.loads(params.get('search_value', '{}'), + object_hook=object_hook) + domain = json.loads(params.get('domain', '[]'), + object_hook=object_hook) + context = json.loads(params.get('context', '{}'), + object_hook=object_hook) except ValueError: return if path: @@ -1597,13 +1601,15 @@ class Main(object): if not wizard: return try: - data = json.loads(params.get('data', '{}')) + data = json.loads(params.get('data', '{}'), + object_hook=object_hook) direct_print = json.loads(params.get('direct_print', 'false')) email_print = json.loads(params.get('email_print', 'false')) email = json.loads(params.get('email', 'null')) name = json.loads(params.get('name', 'false')) window = json.loads(params.get('window', 'false')) - context = json.loads(params.get('context', '{}')) + context = json.loads(params.get('context', '{}'), + object_hook=object_hook) except ValueError: return try: @@ -1618,11 +1624,12 @@ class Main(object): if not report: return try: - data = json.loads(params.get('data')) + data = json.loads(params.get('data'), object_hook=object_hook) direct_print = json.loads(params.get('direct_print', 'false')) email_print = json.loads(params.get('email_print', 'false')) email = json.loads(params.get('email', 'null')) - context = json.loads(params.get('context', '{}')) + context = json.loads(params.get('context', '{}'), + object_hook=object_hook) except ValueError: return try: