[fix] Minor changes in grant application

This commit is contained in:
Vishal
2017-12-01 14:40:24 +05:30
parent 344f5d9cd6
commit 0dbf00a283
2 changed files with 7 additions and 16 deletions

View File

@@ -13,15 +13,15 @@ frappe.ui.form.on('Grant Application', {
frappe.contacts.clear_address_and_contact(frm); frappe.contacts.clear_address_and_contact(frm);
} }
frm.add_custom_button(__("Send Grant Review Email"), function() { if(frm.doc.status == 'Received'){
if (frm.doc.status==="Received") { frm.add_custom_button(__("Send Grant Review Email"), function() {
frappe.call({ frappe.call({
method: "erpnext.non_profit.doctype.grant_application.grant_application.send_grant_review_emails", method: "erpnext.non_profit.doctype.grant_application.grant_application.send_grant_review_emails",
args: { args: {
grant_application: frm.doc.name grant_application: frm.doc.name
} }
}); });
} });
}); }
} }
}); });

View File

@@ -36,16 +36,6 @@ def get_list_context(context):
context.order_by = 'creation desc' context.order_by = 'creation desc'
context.introduction ='<div>Grant Application List</div><br><a class="btn btn-primary" href="/my-grant?new=1">Apply for new Grant Application</a>' context.introduction ='<div>Grant Application List</div><br><a class="btn btn-primary" href="/my-grant?new=1">Apply for new Grant Application</a>'
#Assement Manager review grant on website and submit result
@frappe.whitelist(allow_guest=True)
def assessment_result(title, assessment_scale, note):
vote = frappe.get_doc("Grant Application", title)
vote.assessment_scale = assessment_scale
vote.note = note
vote.save()
frappe.db.commit()
return "Thank you for Assessment Review"
@frappe.whitelist() @frappe.whitelist()
@@ -61,7 +51,8 @@ def send_grant_review_emails(grant_application):
reference_name=grant.name reference_name=grant.name
) )
grant.status = "In Progress" grant.status = 'In Progress'
grant.save() grant.save()
frappe.db.commit()
frappe.msgprint(_("Review Invitation Sent")) frappe.msgprint(_("Review Invitation Sent"))