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:
commit
12f602cc8a
1 changed files with 18 additions and 14 deletions
|
|
@ -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';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue