Browse Source

[FIX] report_xlsx: js

pull/331/head^2
Joan Sisquella 5 years ago
parent
commit
c93c522435
  1. 14
      report_xlsx/static/src/js/report/action_manager_report.js

14
report_xlsx/static/src/js/report/action_manager_report.js

@ -5,7 +5,6 @@ odoo.define("report_xlsx.report", function (require) {
var core = require("web.core");
var ActionManager = require("web.ActionManager");
var crash_manager = require("web.crash_manager");
var framework = require("web.framework");
var session = require("web.session");
var _t = core._t;
@ -13,8 +12,8 @@ odoo.define("report_xlsx.report", function (require) {
ActionManager.include({
_downloadReportXLSX: function (url, actions) {
var self = this;
framework.blockUI();
var def = $.Deferred();
var type = "xlsx";
var cloned_action = _.clone(actions);
var new_url = url;
@ -32,15 +31,16 @@ odoo.define("report_xlsx.report", function (require) {
JSON.stringify(cloned_action.context));
}
return new Promise(function (resolve, reject) {
var blocked = !session.get_file({
url: new_url,
data: {
data: JSON.stringify([new_url, type]),
},
success: def.resolve.bind(def),
error: function () {
crash_manager.rpc_error.apply(crash_manager, arguments);
def.reject();
success: resolve,
error: (error) => {
self.call('crash_manager', 'rpc_error', error);
reject();
},
complete: framework.unblockUI,
});
@ -53,7 +53,7 @@ odoo.define("report_xlsx.report", function (require) {
'popup windows for this page.');
this.do_warn(_t('Warning'), message, true);
}
return def;
});
},
_triggerDownload: function (action, options, type) {

Loading…
Cancel
Save