Merge branch 'master' of github.com:webnotes/erpnext
diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js
index 734e4de..4f35fd4 100644
--- a/erpnext/accounts/page/accounts_browser/accounts_browser.js
+++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js
@@ -116,15 +116,23 @@
 		if(!data) return;
 
 		link.toolbar = $('<span class="tree-node-toolbar"></span>').insertAfter(link);
+		
+		var node_links = [];
 		// edit
-		$('<a href="#!Form/'+encodeURIComponent(this.ctype)+'/'
-			+encodeURIComponent(data.value)+'">Edit</a>').appendTo(link.toolbar);
-
-		if(data.expandable) {
-			link.toolbar.append(' | <a onclick="erpnext.account_chart.new_node();">Add Child</a>');
-		} else if(this.ctype=='Account') {
-			link.toolbar.append(' | <a onclick="erpnext.account_chart.show_ledger();">View Ledger</a>');
+		if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) {
+			node_links.push('<a href="#!Form/'+encodeURIComponent(this.ctype)+'/'
+				+encodeURIComponent(data.value)+'">Edit</a>');
 		}
+		if (data.expandable) {
+			if (wn.boot.profile.can_create.indexOf(this.ctype) !== -1 ||
+					wn.boot.profile.in_create.indexOf(this.ctype) !== -1) {
+				node_links.push('<a onclick="erpnext.account_chart.new_node();">Add Child</a>');
+			}
+		} else if (this.ctype === 'Account' && wn.boot.profile.can_read.indexOf("GL Entry") !== -1) {
+			node_links.push('<a onclick="erpnext.account_chart.show_ledger();">View Ledger</a>');
+		}
+		
+		link.toolbar.append(node_links.join(" | "));
 	},
 	show_ledger: function() {
 		var me = this;
diff --git a/erpnext/patches/august_2012/changed_blog_date_format.py b/erpnext/patches/august_2012/changed_blog_date_format.py
new file mode 100644
index 0000000..d2dd870
--- /dev/null
+++ b/erpnext/patches/august_2012/changed_blog_date_format.py
@@ -0,0 +1,4 @@
+def execute():
+	import webnotes
+	from webnotes.model.doclist import DocList
+	DocList("Website Settings", "Website Settings").save()
\ No newline at end of file
diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py
index 83da5c3..5a0a9d7 100644
--- a/erpnext/patches/patch_list.py
+++ b/erpnext/patches/patch_list.py
@@ -521,4 +521,8 @@
 		'patch_module': 'patches.august_2012',
 		'patch_file': 'report_supplier_quotations',
 	},
+	{
+		'patch_module': 'patches.august_2012',
+		'patch_file': 'changed_blog_date_format',
+	},
 ]
\ No newline at end of file
diff --git a/erpnext/selling/page/sales_browser/sales_browser.js b/erpnext/selling/page/sales_browser/sales_browser.js
index 66e1d52..532728a 100644
--- a/erpnext/selling/page/sales_browser/sales_browser.js
+++ b/erpnext/selling/page/sales_browser/sales_browser.js
@@ -79,12 +79,21 @@
 		link.toolbar = $('<span class="tree-node-toolbar"></span>').insertAfter(link);
 		
 		// edit
-		$('<a href="#!Form/'+encodeURIComponent(this.ctype)+'/'
-			+encodeURIComponent(data.value)+'">Edit</a>').appendTo(link.toolbar);
+		var node_links = [];
+		
+		if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) {
+			node_links.push('<a href="#!Form/'+encodeURIComponent(this.ctype)+'/'
+				+encodeURIComponent(data.value)+'">Edit</a>');
+		}
 
 		if(data.expandable) {
-			link.toolbar.append(' | <a onclick="erpnext.sales_chart.new_node();">Add Child</a>');
+			if (wn.boot.profile.can_create.indexOf(this.ctype) !== -1 ||
+					wn.boot.profile.in_create.indexOf(this.ctype) !== -1) {
+				node_links.push('<a onclick="erpnext.sales_chart.new_node();">Add Child</a>');
+			}
 		}
+		
+		link.toolbar.append(node_links.join(" | "));
 	},
 	new_node: function() {
 		var me = this;
diff --git a/erpnext/support/doctype/communication/communication.js b/erpnext/support/doctype/communication/communication.js
index d6af592..59e2ee9 100644
--- a/erpnext/support/doctype/communication/communication.js
+++ b/erpnext/support/doctype/communication/communication.js
@@ -64,7 +64,7 @@
 		ListView, function(doctype) {
 			var new_doc = LocalDB.create(doctype);
 			new_doc = locals[doctype][new_doc];
-			new_doc[doc.doctype.toLowerCase()] = doc.name;
+			new_doc[doc.doctype.toLowerCase().replace(" ", "_")] = doc.name;
 			loaddoc(new_doc.doctype, new_doc.name);
 		});
 }
@@ -79,7 +79,7 @@
 		var RecordListView = wn.views.RecordListView.extend({
 			default_docstatus: ['0', '1', '2'],
 			default_filters: [
-				[doctype, doc.doctype.toLowerCase(), '=', doc.name],
+				[doctype, doc.doctype.toLowerCase().replace(" ", "_"), '=', doc.name],
 			],
 		});
 		
diff --git a/erpnext/website/blog.py b/erpnext/website/blog.py
index ea1992b..482800e 100644
--- a/erpnext/website/blog.py
+++ b/erpnext/website/blog.py
@@ -98,7 +98,7 @@
 	
 	import webnotes.utils
 	
-	comment['comment_date'] = webnotes.utils.pretty_date(comment['creation'])
+	comment['comment_date'] = webnotes.utils.global_date_format(comment['creation'])
 	template_args = { 'comment_list': [comment], 'template': 'html/comment.html' }
 	
 	# get html of comment row
diff --git a/erpnext/website/doctype/blog/blog.py b/erpnext/website/doctype/blog/blog.py
index 786941c..fc389d0 100644
--- a/erpnext/website/doctype/blog/blog.py
+++ b/erpnext/website/doctype/blog/blog.py
@@ -83,4 +83,4 @@
 		
 		self.doc.comment_list = comment_list or []
 		for comment in self.doc.comment_list:
-			comment['comment_date'] = webnotes.utils.pretty_date(comment['creation'])
\ No newline at end of file
+			comment['comment_date'] = webnotes.utils.global_date_format(comment['creation'])
\ No newline at end of file