From 56f5ec961fe7e1fbe9f6f124aa81f442137dc266 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 15:48:39 +0530 Subject: [PATCH] fix: view ledger button of company on chart of accounts (backport #48677) (#48678) fix: view ledger button of company on chart of accounts (cherry picked from commit 98eb115746a845af826f0858221f99d8688c48be) Co-authored-by: diptanilsaha --- erpnext/accounts/doctype/account/account_tree.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js index 183049c8dfc..84b6239a392 100644 --- a/erpnext/accounts/doctype/account/account_tree.js +++ b/erpnext/accounts/doctype/account/account_tree.js @@ -291,12 +291,14 @@ frappe.treeview_settings["Account"] = { label: __("View Ledger"), click: function (node, btn) { frappe.route_options = { - account: node.label, from_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[1], to_date: erpnext.utils.get_fiscal_year(frappe.datetime.get_today(), true)[2], company: frappe.treeview_settings["Account"].treeview.page.fields_dict.company.get_value(), }; + if (node.parent_label) { + frappe.route_options["account"] = node.label; + } frappe.set_route("query-report", "General Ledger"); }, btnClass: "hidden-xs",