feat: show send acknowledgement button if enabled in settings

This commit is contained in:
Shivam Mishra 2020-08-05 17:33:18 +05:30
parent e4c58c37c8
commit b4d3666e69

View File

@ -17,11 +17,13 @@ frappe.ui.form.on('Membership', {
});
});
frm.add_custom_button("Send Acknowledgement", () => {
frm.call("send_acknowlement").then(() => {
frm.reload_doc();
frappe.db.get_single_value("Membership Settings", "send_email").then(val => {
if (val) frm.add_custom_button("Send Acknowledgement", () => {
frm.call("send_acknowlement").then(() => {
frm.reload_doc();
});
});
});
})
},
onload: function(frm) {