newsletter: allow sending only if write permission

This commit is contained in:
Anand Doshi 2013-01-02 13:48:40 +05:30
parent 325caf33f7
commit 8ab7580d88
2 changed files with 3 additions and 2 deletions

View File

@ -16,7 +16,8 @@
cur_frm.cscript.refresh = function(doc) { cur_frm.cscript.refresh = function(doc) {
erpnext.hide_naming_series(); 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() { cur_frm.add_custom_button('Send', function() {
$c_obj(make_doclist(doc.doctype, doc.name), 'send_emails', '', function(r) { $c_obj(make_doclist(doc.doctype, doc.name), 'send_emails', '', function(r) {
cur_frm.refresh(); cur_frm.refresh();

View File

@ -4,7 +4,7 @@
"docstatus": 0, "docstatus": 0,
"creation": "2013-01-01 13:46:34", "creation": "2013-01-01 13:46:34",
"modified_by": "Administrator", "modified_by": "Administrator",
"modified": "2013-01-02 13:03:29" "modified": "2013-01-02 13:47:36"
}, },
{ {
"autoname": "naming_series:", "autoname": "naming_series:",