From ddfbb07c3bbd5078c3e3459cfb7f2dfb7e093632 Mon Sep 17 00:00:00 2001 From: Prssanna Desai Date: Fri, 6 Sep 2019 15:38:06 +0530 Subject: [PATCH] fix: fix accounts balance timeline dashboard chart source (#18942) * fix: fix accounts balance timeline dashboard chart source * fix: pass chart_name to get function instead of chart object --- .../account_balance_timeline/account_balance_timeline.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py index 648cc68dac..bc07b6d807 100644 --- a/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py +++ b/erpnext/accounts/dashboard_chart_source/account_balance_timeline/account_balance_timeline.py @@ -12,11 +12,14 @@ from frappe.utils.nestedset import get_descendants_of @frappe.whitelist() @cache_source -def get(chart_name=None, from_date = None, to_date = None): - chart = frappe.get_doc('Dashboard Chart', chart_name) +def get(chart_name = None, chart = None, no_cache = None, from_date = None, to_date = None): + if chart_name: + chart = frappe.get_doc('Dashboard Chart', chart_name) + else: + chart = frappe._dict(frappe.parse_json(chart)) timespan = chart.timespan timegrain = chart.time_interval - filters = json.loads(chart.filters_json) + filters = frappe.parse_json(chart.filters_json) account = filters.get("account") company = filters.get("company")