mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
[fix] Modified Grant Application Test
This commit is contained in:
@@ -13,5 +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") {
|
||||||
|
frappe.call({
|
||||||
|
method: "erpnext.non_profit.doctype.grant_application.grant_application.send_grant_review_emails",
|
||||||
|
args: {
|
||||||
|
grant_application: frm.doc.name
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ 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)
|
@frappe.whitelist(allow_guest=True)
|
||||||
def assessment_result(title, assessment_scale, note):
|
def assessment_result(title, assessment_scale, note):
|
||||||
vote = frappe.get_doc("Grant Application", title)
|
vote = frappe.get_doc("Grant Application", title)
|
||||||
@@ -36,3 +37,23 @@ def assessment_result(title, assessment_scale, note):
|
|||||||
vote.save()
|
vote.save()
|
||||||
frappe.db.commit()
|
frappe.db.commit()
|
||||||
return "Thank you for Assessment Review"
|
return "Thank you for Assessment Review"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def send_grant_review_emails(grant_application):
|
||||||
|
grant = frappe.get_doc("Grant Application", grant_application)
|
||||||
|
|
||||||
|
frappe.sendmail(
|
||||||
|
recipients= grant.assessment_manager,
|
||||||
|
sender=frappe.session.user,
|
||||||
|
subject=grant.title,
|
||||||
|
message='<p> Please Review this grant application</p><br>' ,
|
||||||
|
reference_doctype=grant.doctype,
|
||||||
|
reference_name=grant.name
|
||||||
|
)
|
||||||
|
|
||||||
|
grant.status = "In Progress"
|
||||||
|
meeting.save()
|
||||||
|
|
||||||
|
frappe.msgprint(_("Invitation Sent"))
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ QUnit.test("test: Grant Application", function (assert) {
|
|||||||
// insert a new Member
|
// insert a new Member
|
||||||
() => frappe.tests.make('Grant Application', [
|
() => frappe.tests.make('Grant Application', [
|
||||||
// values to be set
|
// values to be set
|
||||||
{organization: 'Test Organization'},
|
{title: 'Test Organization'},
|
||||||
{grant_applicant_name:'Test Applicant'},
|
{grant_applicant_name:'Test Applicant'},
|
||||||
{email: 'test@example.com'},
|
{email: 'test@example.com'},
|
||||||
{grant_description:'Test message'},
|
{grant_description:'Test message'},
|
||||||
@@ -21,7 +21,7 @@ QUnit.test("test: Grant Application", function (assert) {
|
|||||||
{grant_past_record:'NO'}
|
{grant_past_record:'NO'}
|
||||||
]),
|
]),
|
||||||
() => {
|
() => {
|
||||||
assert.equal(cur_frm.doc.organization, 'Test Organization');
|
assert.equal(cur_frm.doc.title, 'Test Organization');
|
||||||
assert.equal(cur_frm.doc.grant_applicant_name, 'Test Applicant');
|
assert.equal(cur_frm.doc.grant_applicant_name, 'Test Applicant');
|
||||||
assert.equal(cur_frm.doc.email, 'test@example.com');
|
assert.equal(cur_frm.doc.email, 'test@example.com');
|
||||||
assert.equal(cur_frm.doc.amount, 150000);
|
assert.equal(cur_frm.doc.amount, 150000);
|
||||||
|
|||||||
Reference in New Issue
Block a user