From 60dcaa123a14f0bd11a8dc5679b1ca7b70e8a837 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 13 Dec 2012 12:34:16 +0530 Subject: [PATCH] Make new button in doclistview should check for create permission --- public/js/wn/views/doclistview.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/public/js/wn/views/doclistview.js b/public/js/wn/views/doclistview.js index 99c645710f..04c5e604f9 100644 --- a/public/js/wn/views/doclistview.js +++ b/public/js/wn/views/doclistview.js @@ -168,14 +168,14 @@ wn.views.DocListView = wn.ui.Listing.extend({ }, make_no_result: function() { + var new_button = wn.boot.profile.can_create.indexOf(this.doctype)!=-1 + ? '

' + : ''; var no_result_message = repl('
\ -

No %(doctype_label)s found

\ -
\ -

\ -

', { +

No %(doctype_label)s found

' + new_button + '', { doctype_label: wn._(this.doctype), - doctype: this.doctype + doctype: this.doctype, }); return no_result_message;