Browse Source

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 3162d192b8)

* fix: added missing operators

(cherry picked from commit fc1e01555b)

Co-authored-by: Shariq Ansari <sharique.rik@gmail.com>
version-14
mergify[bot] 2 years ago
committed by GitHub
parent
commit
775ed71fd1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 2 deletions
  1. +0
    -1
      frappe/desk/doctype/dashboard_chart/dashboard_chart.py
  2. +1
    -1
      frappe/model/db_query.py

+ 0
- 1
frappe/desk/doctype/dashboard_chart/dashboard_chart.py View File

@@ -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)


+ 1
- 1
frappe/model/db_query.py View File

@@ -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}'"



Loading…
Cancel
Save