diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index 734e4de18a..4f35fd4156 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -116,15 +116,23 @@ erpnext.AccountsChart = Class.extend({ if(!data) return; link.toolbar = $('').insertAfter(link); + + var node_links = []; // edit - $('Edit').appendTo(link.toolbar); - - if(data.expandable) { - link.toolbar.append(' | Add Child'); - } else if(this.ctype=='Account') { - link.toolbar.append(' | View Ledger'); + if (wn.boot.profile.can_read.indexOf(this.ctype) !== -1) { + node_links.push('Edit'); } + 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('Add Child'); + } + } else if (this.ctype === 'Account' && wn.boot.profile.can_read.indexOf("GL Entry") !== -1) { + node_links.push('View Ledger'); + } + + 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 0000000000..d2dd87069c --- /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 83da5c3fa3..5a0a9d7857 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -521,4 +521,8 @@ patch_list = [ '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 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; diff --git a/erpnext/support/doctype/communication/communication.js b/erpnext/support/doctype/communication/communication.js index d6af592048..59e2ee9c55 100644 --- a/erpnext/support/doctype/communication/communication.js +++ b/erpnext/support/doctype/communication/communication.js @@ -64,7 +64,7 @@ cur_frm.cscript.render_communication_list = function(doc, dt, dn) { 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 @@ cur_frm.cscript.render_list = function(doc, doctype, wrapper, ListView, make_new 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 ea1992b1fe..482800ec4e 100644 --- a/erpnext/website/blog.py +++ b/erpnext/website/blog.py @@ -98,7 +98,7 @@ def add_comment(args=None): 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 786941c7e1..fc389d09d7 100644 --- a/erpnext/website/doctype/blog/blog.py +++ b/erpnext/website/doctype/blog/blog.py @@ -83,4 +83,4 @@ class DocType(website.web_page.Page): 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