diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js
index 66e1d52bc0..532728a99d 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.js
+++ b/erpnext/selling/page/sales_browser/sales_browser.js
@@ -79,12 +79,21 @@ erpnext.SalesChart = Class.extend({
link.toolbar = $('').insertAfter(link);
// edit
- $('Edit').appendTo(link.toolbar);
+ var node_links = [];
+
+ if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) {
+ node_links.push('Edit');
+ }
if(data.expandable) {
- link.toolbar.append(' | Add Child');
+ if (wn.boot.profile.can_create.indexOf(this.ctype) !== -1 ||
+ wn.boot.profile.in_create.indexOf(this.ctype) !== -1) {
+ node_links.push('Add Child');
+ }
}
+
+ link.toolbar.append(node_links.join(" | "));
},
new_node: function() {
var me = this;