fix: Set student email id mandatory only if skip user creation is disabled
This commit is contained in:
parent
af1c4ba443
commit
06f89a1b94
@ -3,15 +3,15 @@
|
|||||||
|
|
||||||
frappe.ui.form.on('Student', {
|
frappe.ui.form.on('Student', {
|
||||||
setup: function(frm) {
|
setup: function(frm) {
|
||||||
frm.add_fetch("guardian", "guardian_name", "guardian_name");
|
frm.add_fetch('guardian', 'guardian_name', 'guardian_name');
|
||||||
frm.add_fetch("student", "title", "full_name");
|
frm.add_fetch('student', 'title', 'full_name');
|
||||||
frm.add_fetch("student", "gender", "gender");
|
frm.add_fetch('student', 'gender', 'gender');
|
||||||
frm.add_fetch("student", "date_of_birth", "date_of_birth");
|
frm.add_fetch('student', 'date_of_birth', 'date_of_birth');
|
||||||
|
|
||||||
frm.set_query("student", "siblings", function(doc, cdt, cdn) {
|
frm.set_query('student', 'siblings', function(doc, cdt, cdn) {
|
||||||
return {
|
return {
|
||||||
"filters": {
|
'filters': {
|
||||||
"name": ["!=", doc.name]
|
'name': ['!=', doc.name]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@ -25,6 +25,12 @@ frappe.ui.form.on('Student', {
|
|||||||
{party_type:'Student', party:frm.doc.name});
|
{party_type:'Student', party:frm.doc.name});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frappe.db.get_value('Education Settings', {name: 'Education Settings'}, 'user_creation_skip', (r) => {
|
||||||
|
if (r.user_creation_skip === "0") {
|
||||||
|
frm.set_df_property('student_email_id', 'reqd', 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -102,7 +102,6 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"in_global_search": 1,
|
"in_global_search": 1,
|
||||||
"label": "Student Email Address",
|
"label": "Student Email Address",
|
||||||
"reqd": 1,
|
|
||||||
"unique": 1
|
"unique": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -255,7 +254,7 @@
|
|||||||
],
|
],
|
||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2020-07-23 18:14:06.366442",
|
"modified": "2020-09-07 19:28:08.914568",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Education",
|
"module": "Education",
|
||||||
"name": "Student",
|
"name": "Student",
|
||||||
|
@ -7,7 +7,7 @@ frappe.ui.form.on("Student Applicant", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
refresh: function(frm) {
|
refresh: function(frm) {
|
||||||
if(frm.doc.application_status== "Applied" && frm.doc.docstatus== 1 ) {
|
if (frm.doc.application_status==="Applied" && frm.doc.docstatus===1 ) {
|
||||||
frm.add_custom_button(__("Approve"), function() {
|
frm.add_custom_button(__("Approve"), function() {
|
||||||
frm.set_value("application_status", "Approved");
|
frm.set_value("application_status", "Approved");
|
||||||
frm.save_or_update();
|
frm.save_or_update();
|
||||||
@ -20,10 +20,11 @@ frappe.ui.form.on("Student Applicant", {
|
|||||||
}, 'Actions');
|
}, 'Actions');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(frm.doc.application_status== "Approved" && frm.doc.docstatus== 1 ) {
|
if (frm.doc.application_status === "Approved" && frm.doc.docstatus === 1) {
|
||||||
frm.add_custom_button(__("Enroll"), function() {
|
frm.add_custom_button(__("Enroll"), function() {
|
||||||
frm.events.enroll(frm)
|
frm.events.enroll(frm)
|
||||||
}).addClass("btn-primary");
|
}).addClass("btn-primary");
|
||||||
|
|
||||||
frm.add_custom_button(__("Reject"), function() {
|
frm.add_custom_button(__("Reject"), function() {
|
||||||
frm.set_value("application_status", "Rejected");
|
frm.set_value("application_status", "Rejected");
|
||||||
frm.save_or_update();
|
frm.save_or_update();
|
||||||
@ -35,7 +36,13 @@ frappe.ui.form.on("Student Applicant", {
|
|||||||
frappe.hide_msgprint(true);
|
frappe.hide_msgprint(true);
|
||||||
frappe.show_progress(__("Enrolling student"), data.progress[0],data.progress[1]);
|
frappe.show_progress(__("Enrolling student"), data.progress[0],data.progress[1]);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
|
frappe.db.get_value("Education Settings", {name: "Education Settings"}, "user_creation_skip", (r) => {
|
||||||
|
if (r.user_creation_skip === "0") {
|
||||||
|
frm.set_df_property("student_email_id", "reqd", 1);
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
enroll: function(frm) {
|
enroll: function(frm) {
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user