Skip to content

Commit

Permalink
fix(UX): Provision to ignore prepared report via route options (#22077)
Browse files Browse the repository at this point in the history
* chore: Provision to ignore prepared report via route options (#22077)

(cherry picked from commit 112836d)

# Conflicts:
#	frappe/desk/query_report.py

* chore: resolve conflicts

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
  • Loading branch information
mergify[bot] and deepeshgarg007 committed Aug 17, 2023
1 parent 04ac8ff commit 6bac8a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/desk/query_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def run(
if (
report.prepared_report
and not report.disable_prepared_report
and not ignore_prepared_report
and not sbool(ignore_prepared_report)
and not custom_columns
):
dn = None
Expand Down
4 changes: 4 additions & 0 deletions frappe/public/js/frappe/views/reports/query_report.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,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 = [];
}

Expand Down Expand Up @@ -589,6 +590,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);
}
}
Expand Down Expand Up @@ -636,6 +639,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,
Expand Down

0 comments on commit 6bac8a8

Please sign in to comment.