Skip to content

Commit

Permalink
Simplify js code
Browse files Browse the repository at this point in the history
  • Loading branch information
TDu committed Jun 26, 2018
1 parent 5bd0a2a commit ce2a010
Showing 1 changed file with 23 additions and 26 deletions.
49 changes: 23 additions & 26 deletions l10n_ch_payment_slip/static/src/js/qwebactionmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,30 @@ var framework = require('web.framework');

ActionManager.include({
ir_actions_report: function (action, options){
if (action.report_type === 'reportlab_pdf') {
var client_action_options = _.extend({}, options, {
report_url: '/report/reportlab_pdf/' + action.report_name + '/' + action.context.active_ids.join(','),
report_name: action.report_name,
report_file: action.report_file,
data: action.data,
context: action.context,
name: action.name,
display_name: action.display_name,
});
this.getSession().get_file({
url: client_action_options.report_url,
data: {data: JSON.stringify([
client_action_options.report_url,
action.report_type,
])},
error: crash_manager.rpc_error.bind(crash_manager),
success: function() {
if(action && options && !action.dialog){
options.on_close();
}
},
});
framework.unblockUI()
return
var report_url;

if (action.report_type !== 'reportlab_pdf') {
return this._super(action, options);
}
return this._super(action, options)
framework.blockUI();
report_url = '/report/reportlab_pdf/'.concat(
action.report_name,'/',
action.context.active_ids.join(',')
);
this.getSession().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();
}
},
});
framework.unblockUI();
return;
}
});
});

0 comments on commit ce2a010

Please sign in to comment.