From b5e62214fac39de93f10e6085bbb01914fa5e66f Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Fri, 16 Jan 2015 14:54:28 +0100 Subject: [PATCH] [FIX] report: reload record after report printed --- addons/report/static/src/js/qwebactionmanager.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/report/static/src/js/qwebactionmanager.js b/addons/report/static/src/js/qwebactionmanager.js index 088c40e800a..74de70d03dd 100644 --- a/addons/report/static/src/js/qwebactionmanager.js +++ b/addons/report/static/src/js/qwebactionmanager.js @@ -1,14 +1,19 @@ openerp.report = function(instance) { var wkhtmltopdf_state; - var trigger_download = function(session, response, c) { + var trigger_download = function(session, response, c, action, options) { session.get_file({ url: '/report/download', data: {data: JSON.stringify(response)}, complete: openerp.web.unblockUI, - error: c.rpc_error.bind(c) + error: c.rpc_error.bind(c), + success: function(){ + if (action && options && !action.dialog) { + options.on_close(); + } + }, }); - } + }; instance.web.ActionManager = instance.web.ActionManager.extend({ ir_actions_report_xml: function(action, options) { @@ -79,10 +84,10 @@ workers to print a pdf version of the reports.'), true); support for table-breaking between pages.

wkhtmltopdf.org'), true); } - return trigger_download(self.session, response, c); + return trigger_download(self.session, response, c, action, options); }); } else if (action.report_type === 'controller') { - return trigger_download(self.session, response, c); + return trigger_download(self.session, response, c, action, options); } } else { return self._super(action, options);