[fix] Modified Grant Application Test
diff --git a/erpnext/non_profit/doctype/grant_application/grant_application.js b/erpnext/non_profit/doctype/grant_application/grant_application.js
index bfc2f65..e13fee9 100644
--- a/erpnext/non_profit/doctype/grant_application/grant_application.js
+++ b/erpnext/non_profit/doctype/grant_application/grant_application.js
@@ -13,5 +13,15 @@
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
+ }
+ });
+ }
+ });
}
});
diff --git a/erpnext/non_profit/doctype/grant_application/grant_application.py b/erpnext/non_profit/doctype/grant_application/grant_application.py
index 44127f9..9f118c8 100644
--- a/erpnext/non_profit/doctype/grant_application/grant_application.py
+++ b/erpnext/non_profit/doctype/grant_application/grant_application.py
@@ -28,6 +28,7 @@
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>'
+#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)
@@ -35,4 +36,24 @@
vote.note = note
vote.save()
frappe.db.commit()
- return "Thank you for Assessment Review"
\ No newline at end of file
+ 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"))
diff --git a/erpnext/non_profit/doctype/grant_application/test_grant_application.js b/erpnext/non_profit/doctype/grant_application/test_grant_application.js
index 89bf35e..78d48d3 100644
--- a/erpnext/non_profit/doctype/grant_application/test_grant_application.js
+++ b/erpnext/non_profit/doctype/grant_application/test_grant_application.js
@@ -12,7 +12,7 @@
// insert a new Member
() => frappe.tests.make('Grant Application', [
// values to be set
- {organization: 'Test Organization'},
+ {title: 'Test Organization'},
{grant_applicant_name:'Test Applicant'},
{email: 'test@example.com'},
{grant_description:'Test message'},
@@ -21,7 +21,7 @@
{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.email, 'test@example.com');
assert.equal(cur_frm.doc.amount, 150000);