diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-01-19 17:15:56 +0100 |
| commit | 18e22be138f4d273ce8f63c0ff2c8a437cf6ce5d (patch) | |
| tree | 63bd658de7b6fa0e91d521ca19322dd68bdc1492 /addons/report/static/src/js | |
| parent | f6e5bf847b1a7107c09b009a757823b0f9514fa4 (diff) | |
| parent | 0aab81cd3ac6881b2b64ccedb901b55badd421d4 (diff) | |
[MERGE] forward port of branch 8.0 up to 0aab81c
Diffstat (limited to 'addons/report/static/src/js')
| -rw-r--r-- | addons/report/static/src/js/qwebactionmanager.js | 15 |
1 files 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.<br><br><a href="http://wkhtmltopdf.org/" \ target="_blank">wkhtmltopdf.org</a>'), 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); |
