[fix] ledger view from coa
diff --git a/erpnext/accounts/doctype/account/account_tree.js b/erpnext/accounts/doctype/account/account_tree.js
index db15eef..8aee1ba 100644
--- a/erpnext/accounts/doctype/account/account_tree.js
+++ b/erpnext/accounts/doctype/account/account_tree.js
@@ -48,5 +48,24 @@
+ " " + dr_or_cr
+ '</span>').insertBefore(node.$ul);
}
- }
+ },
+ toolbar: [
+ {
+ condition: function(node) {
+ return !node.root && frappe.boot.user.can_read.indexOf("GL Entry") !== -1
+ },
+ label: __("View Ledger"),
+ click: function(node, btn) {
+ frappe.route_options = {
+ "account": node.label,
+ "from_date": sys_defaults.year_start_date,
+ "to_date": sys_defaults.year_end_date,
+ "company": frappe.defaults.get_default('company') ? frappe.defaults.get_default('company'): ""
+ };
+ frappe.set_route("query-report", "General Ledger");
+ },
+ btnClass: "hidden-xs"
+ }
+ ],
+ extend_toolbar: true
}
\ No newline at end of file