Fix report_xlsx for printing from wizards

This commit is contained in:
Graeme Gellatly
2018-08-25 15:20:02 +12:00
committed by Alex Cuellar
parent 498fd57c87
commit fcc3c36c56
4 changed files with 74 additions and 12 deletions

View File

@@ -14,9 +14,14 @@ ActionManager.include({
if (cloned_action.report_type === 'xlsx') {
framework.blockUI();
var report_xlsx_url = 'report/xlsx/' + cloned_action.report_name;
if(cloned_action.context.active_ids){
report_xlsx_url += '/' + cloned_action.context.active_ids.join(',');
}else{
if (_.isUndefined(cloned_action.data) ||
_.isNull(cloned_action.data) ||
(_.isObject(cloned_action.data) && _.isEmpty(cloned_action.data)))
{
if(cloned_action.context.active_ids) {
report_xlsx_url += '/' + cloned_action.context.active_ids.join(',');
}
} else {
report_xlsx_url += '?options=' + encodeURIComponent(JSON.stringify(cloned_action.data));
report_xlsx_url += '&context=' + encodeURIComponent(JSON.stringify(cloned_action.context));
}