feat(dashboard): Set account from filters
diff --git a/erpnext/accounts/dashboard.py b/erpnext/accounts/dashboard.py
index b6ac4de..5d3984e 100644
--- a/erpnext/accounts/dashboard.py
+++ b/erpnext/accounts/dashboard.py
@@ -13,13 +13,14 @@
print(filters)
timespan = filters.get("timespan")
timegrain = filters.get("timegrain")
+ account = filters.get("account")
from_date = get_from_date_from_timespan(timespan)
to_date = nowdate()
filters = frappe._dict({
"company": "Gadget Technologies Pvt. Ltd.",
"from_date": from_date,
"to_date": to_date,
- "account": "Cash - GTPL",
+ "account": account,
"group_by": "Group by Voucher (Consolidated)"
})
report_columns, report_results = execute(filters=filters)
@@ -45,7 +46,7 @@
return {
"labels": [result[0] for result in results],
"datasets": [{
- "name": "Cash - GTPL",
+ "name": account,
"values": [result[1] for result in results]
}]
}