Skip to content

Commit

Permalink
Merge PR #539 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by yvaucher
  • Loading branch information
OCA-git-bot committed Feb 4, 2020
2 parents 872191c + 824a01d commit 64fa9c4
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions l10n_ch_payment_slip/static/src/js/qwebactionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,38 @@ odoo.define('l10n_ch_payment_slip.report', function (require) {
var ActionManager= require('web.ActionManager');
var crash_manager = require('web.crash_manager');
var framework = require('web.framework');

var session = require('web.session');

ActionManager.include({
ir_actions_report: function (action, options) {
var report_url = '';

_executeReportAction: function (action, options) {
if (action.report_type !== 'reportlab-pdf') {
return this._super(action, options);
}
framework.blockUI();
report_url = '/report/reportlab-pdf/'.concat(
var def = $.Deferred();
var report_url = '/report/reportlab-pdf/'.concat(
action.report_name, '/',
action.context.active_ids.join(',')
);
this.getSession().get_file({
var blocked = !session.get_file({
url: report_url,
data:{
data: JSON.stringify([report_url, action.report_type]),
},
error: crash_manager.rpc_error.bind(crash_manager),
success: function () {
if (action && options && !action.dialog) {
options.on_close();
}
},
success: def.resolve.bind(def),
complete: framework.unblockUI,
});
framework.unblockUI();
return;
if (blocked) {
// AAB: this check should be done in get_file service directly,
// should not be the concern of the caller (and that way, get_file
// could return a deferred)
var message = _t('A popup window with your report was blocked. You ' +
'may need to change your browser settings to allow ' +
'popup windows for this page.');
this.do_warn(_t('Warning'), message, true);
}
return def;
},
});
});

0 comments on commit 64fa9c4

Please sign in to comment.