mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-24 15:39:20 +00:00
Merge pull request #53223 from Shllokkk/dashboard-chart-fix
Bank balance chart fix for payments dashboard
This commit is contained in:
@@ -17,6 +17,15 @@ frappe.dashboards.chart_sources["Account Balance Timeline"] = {
|
|||||||
fieldtype: "Link",
|
fieldtype: "Link",
|
||||||
options: "Account",
|
options: "Account",
|
||||||
reqd: 1,
|
reqd: 1,
|
||||||
|
default: locals[":Company"][frappe.defaults.get_user_default("Company")]["default_bank_account"],
|
||||||
|
get_query: () => {
|
||||||
|
return {
|
||||||
|
filters: {
|
||||||
|
account_type: "Bank",
|
||||||
|
is_group: 0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -37,21 +37,14 @@ def get(
|
|||||||
filters = frappe.parse_json(filters) or frappe.parse_json(chart.filters_json)
|
filters = frappe.parse_json(filters) or frappe.parse_json(chart.filters_json)
|
||||||
|
|
||||||
account = filters.get("account")
|
account = filters.get("account")
|
||||||
filters.get("company")
|
company = filters.get("company")
|
||||||
|
|
||||||
if not account and chart_name:
|
if not company and not account:
|
||||||
frappe.throw(
|
frappe.throw(_("Company and account filters not set!"))
|
||||||
_("Account is not set for the dashboard chart {0}").format(
|
if not company:
|
||||||
get_link_to_form("Dashboard Chart", chart_name)
|
frappe.throw(_("Company filter not set!"))
|
||||||
)
|
if not account:
|
||||||
)
|
frappe.throw(_("Account filter not set!"))
|
||||||
|
|
||||||
if not frappe.db.exists("Account", account) and chart_name:
|
|
||||||
frappe.throw(
|
|
||||||
_("Account {0} does not exists in the dashboard chart {1}").format(
|
|
||||||
account, get_link_to_form("Dashboard Chart", chart_name)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
if not to_date:
|
if not to_date:
|
||||||
to_date = nowdate()
|
to_date = nowdate()
|
||||||
|
|||||||
Reference in New Issue
Block a user