From 775ed71fd1289ab7e19376ebf5d2044dc9922e22 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 18:22:29 +0530 Subject: [PATCH] fix: Chart filter not working if not operator is used (backport #18194) (#18265) * fix: Chart filter not working if not operator is used (cherry picked from commit 3162d192b87960b5705cb9c3d77d6175b4ab8fcc) * fix: added missing operators (cherry picked from commit fc1e01555b7b2b815e5ca9e56b3964301bdf003a) Co-authored-by: Shariq Ansari --- frappe/desk/doctype/dashboard_chart/dashboard_chart.py | 1 - frappe/model/db_query.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/frappe/desk/doctype/dashboard_chart/dashboard_chart.py b/frappe/desk/doctype/dashboard_chart/dashboard_chart.py index 6f675831a7..fddf4f1120 100644 --- a/frappe/desk/doctype/dashboard_chart/dashboard_chart.py +++ b/frappe/desk/doctype/dashboard_chart/dashboard_chart.py @@ -215,7 +215,6 @@ def get_chart_config(chart, filters, timespan, timegrain, from_date, to_date): group_by="_unit", order_by="_unit asc", as_list=True, - ignore_ifnull=True, ) result = get_result(data, timegrain, from_date, to_date, chart.chart_type) diff --git a/frappe/model/db_query.py b/frappe/model/db_query.py index 87e3d83e9c..95e6179b29 100644 --- a/frappe/model/db_query.py +++ b/frappe/model/db_query.py @@ -642,7 +642,7 @@ class DatabaseQuery: f.value = date_range fallback = f"'{FallBackDateTimeStr}'" - if f.operator in (">", "<") and (f.fieldname in ("creation", "modified")): + if f.operator in (">", "<", ">=", "<=") and (f.fieldname in ("creation", "modified")): value = cstr(f.value) fallback = f"'{FallBackDateTimeStr}'"