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
This commit is contained in:
Prssanna Desai 2019-09-06 15:38:06 +05:30 committed by Nabin Hait
parent d30f87bbdf
commit ddfbb07c3b

View File

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