Merge pull request #8444 from ruchamahabal/export_report_fix

fix(report-view): show export all checkbox only if total row count ex…
This commit is contained in:
mergify[bot] 2019-09-18 06:47:13 +00:00 committed by GitHub
commit 12f602cc8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1231,23 +1231,27 @@ frappe.views.ReportView = class ReportView extends frappe.views.ListView {
action: () => {
const args = this.get_args();
const selected_items = this.get_checked_items(true);
let fields = [
{
fieldtype: 'Select',
label: __('Select File Type'),
fieldname:'file_format_type',
options: ['Excel', 'CSV'],
default: 'Excel'
}
];
if (this.total_count > args.page_length) {
fields.push({
fieldtype: 'Check',
fieldname: 'export_all_rows',
label: __('Export All {0} rows?', [(this.total_count + "").bold()])
});
}
const d = new frappe.ui.Dialog({
title: __("Export Report: {0}",[__(this.doctype)]),
fields: [
{
fieldtype: 'Select',
label: __('Select File Type'),
fieldname:'file_format_type',
options: ['Excel', 'CSV'],
default: 'Excel'
},
{
fieldtype: 'Check',
fieldname: 'export_all_rows',
label: __('Export All {0} rows?', [(this.total_count + "").bold()])
}
],
fields: fields,
primary_action_label: __('Download'),
primary_action: (data) => {
args.cmd = 'frappe.desk.reportview.export_query';