diff --git a/frappe/desk/query_report.py b/frappe/desk/query_report.py index 6f4bc716aa..5b7c450ae9 100644 --- a/frappe/desk/query_report.py +++ b/frappe/desk/query_report.py @@ -171,6 +171,7 @@ def get_script(report_name): "script": render_include(script), "html_format": html_format, "execution_time": frappe.cache.hget("report_execution_time", report_name) or 0, + "filters": report.filters, } diff --git a/frappe/public/js/frappe/views/reports/report_utils.js b/frappe/public/js/frappe/views/reports/report_utils.js index 9713f8bb99..d75716541b 100644 --- a/frappe/public/js/frappe/views/reports/report_utils.js +++ b/frappe/public/js/frappe/views/reports/report_utils.js @@ -126,6 +126,13 @@ frappe.report_utils = { .then((r) => { frappe.dom.eval(r.script || ""); return frappe.after_ajax(() => { + if ( + frappe.query_reports[report_name] && + !frappe.query_reports[report_name].filter && + r.filters + ) { + return (frappe.query_reports[report_name].filters = r.filters); + } return ( frappe.query_reports[report_name] && frappe.query_reports[report_name].filters