mirror of
https://github.com/NaN-tic/tryton-gtk2.git
synced 2023-12-14 03:12:58 +01:00
Make report more fault tolerant
This commit is contained in:
parent
b99fbd4fee
commit
12096dd413
1 changed files with 4 additions and 1 deletions
|
@ -30,8 +30,11 @@ class Action(object):
|
|||
datas['id'] = ids[0]
|
||||
ctx = rpc.session.context.copy()
|
||||
ctx.update(context)
|
||||
(type, data) = rpc.session.rpc_exec_auth('/report', 'execute', name,
|
||||
res = rpc.session.rpc_exec_auth('/report', 'execute', name,
|
||||
ids, datas, ctx)
|
||||
if not res:
|
||||
return False
|
||||
(type, data) = res
|
||||
(fileno, fp_name) = tempfile.mkstemp('.' + type, 'tryton_')
|
||||
file_d = os.fdopen(fileno, 'wb+')
|
||||
file_d.write(base64.decodestring(data))
|
||||
|
|
Loading…
Reference in a new issue