From 0865f606735715b80ee4abb359cc30dfebf5083a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 11 Jun 2013 17:48:59 +0530 Subject: [PATCH] [chart of accounts/cost center] [fix] check permission before enabling add child --- accounts/page/accounts_browser/accounts_browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/accounts/page/accounts_browser/accounts_browser.js b/accounts/page/accounts_browser/accounts_browser.js index 2e8cc820a6..3541fcbf1f 100644 --- a/accounts/page/accounts_browser/accounts_browser.js +++ b/accounts/page/accounts_browser/accounts_browser.js @@ -131,7 +131,7 @@ erpnext.AccountsChart = Class.extend({ if (wn.model.can_read(this.ctype) !== -1) { node_links.push('Edit'); } - if (data.expandable) { + if (data.expandable && wn.boot.profile.in_create.indexOf(this.ctype) !== -1) { node_links.push('Add Child'); } else if (this.ctype === 'Account' && wn.boot.profile.can_read.indexOf("GL Entry") !== -1) { node_links.push('View Ledger');