chore: Provision to ignore prepared report via route options (#22077)

This commit is contained in:
Deepesh Garg 2023-08-16 20:18:57 +05:30 committed by GitHub
parent 274ffe8d68
commit 112836dcd7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -201,7 +201,7 @@ def run(
if sbool(are_default_filters) and report.custom_filters:
filters = report.custom_filters
if report.prepared_report and not ignore_prepared_report and not custom_columns:
if report.prepared_report and not sbool(ignore_prepared_report) and not custom_columns:
if filters:
if isinstance(filters, str):
filters = json.loads(filters)

View file

@ -57,6 +57,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
// throttle refresh for 300ms
this.refresh = frappe.utils.throttle(this.refresh, 300);
this.ignore_prepared_report = false;
this.menu_items = [];
}
@ -592,6 +593,8 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
frappe.route_options = null;
});
this.ignore_prepared_report = route_options["ignore_prepared_report"] || false;
return frappe.run_serially(promises);
}
}
@ -639,6 +642,7 @@ frappe.views.QueryReport = class QueryReport extends frappe.views.BaseList {
args: {
report_name: this.report_name,
filters: filters,
ignore_prepared_report: this.ignore_prepared_report,
is_tree: this.report_settings.tree,
parent_field: this.report_settings.parent_field,
are_default_filters: are_default_filters,