From 8ab7580d88cf0f74c06aae14246127a0dc01044f Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 2 Jan 2013 13:48:40 +0530 Subject: [PATCH] newsletter: allow sending only if write permission --- support/doctype/newsletter/newsletter.js | 3 ++- support/doctype/newsletter/newsletter.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/support/doctype/newsletter/newsletter.js b/support/doctype/newsletter/newsletter.js index 69881cd11d..0a3fbe81fb 100644 --- a/support/doctype/newsletter/newsletter.js +++ b/support/doctype/newsletter/newsletter.js @@ -16,7 +16,8 @@ cur_frm.cscript.refresh = function(doc) { erpnext.hide_naming_series(); - if(!doc.__islocal && !cint(doc.email_sent) && !doc.__unsaved) { + if(!doc.__islocal && !cint(doc.email_sent) && !doc.__unsaved + && inList(wn.boot.can_write, doc.doctype)) { cur_frm.add_custom_button('Send', function() { $c_obj(make_doclist(doc.doctype, doc.name), 'send_emails', '', function(r) { cur_frm.refresh(); diff --git a/support/doctype/newsletter/newsletter.txt b/support/doctype/newsletter/newsletter.txt index 4382379d08..04701e86e5 100644 --- a/support/doctype/newsletter/newsletter.txt +++ b/support/doctype/newsletter/newsletter.txt @@ -4,7 +4,7 @@ "docstatus": 0, "creation": "2013-01-01 13:46:34", "modified_by": "Administrator", - "modified": "2013-01-02 13:03:29" + "modified": "2013-01-02 13:47:36" }, { "autoname": "naming_series:",