mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
[fix] check if academic_year exists (#13665)
This commit is contained in:
@@ -82,36 +82,39 @@ frappe.ui.form.on("Student Group", {
|
|||||||
max_roll_no = d.group_roll_number;
|
max_roll_no = d.group_roll_number;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
frappe.call({
|
|
||||||
method: "erpnext.education.doctype.student_group.student_group.get_students",
|
if(frm.doc.academic_year) {
|
||||||
args: {
|
frappe.call({
|
||||||
"academic_year": frm.doc.academic_year,
|
method: "erpnext.education.doctype.student_group.student_group.get_students",
|
||||||
"academic_term": frm.doc.academic_term,
|
args: {
|
||||||
"group_based_on": frm.doc.group_based_on,
|
"academic_year": frm.doc.academic_year,
|
||||||
"program": frm.doc.program,
|
"academic_term": frm.doc.academic_term,
|
||||||
"batch" : frm.doc.batch,
|
"group_based_on": frm.doc.group_based_on,
|
||||||
"course": frm.doc.course
|
"program": frm.doc.program,
|
||||||
},
|
"batch" : frm.doc.batch,
|
||||||
callback: function(r) {
|
"course": frm.doc.course
|
||||||
if(r.message) {
|
},
|
||||||
$.each(r.message, function(i, d) {
|
callback: function(r) {
|
||||||
if(!in_list(student_list, d.student)) {
|
if(r.message) {
|
||||||
var s = frm.add_child("students");
|
$.each(r.message, function(i, d) {
|
||||||
s.student = d.student;
|
if(!in_list(student_list, d.student)) {
|
||||||
s.student_name = d.student_name;
|
var s = frm.add_child("students");
|
||||||
if (d.active === 0) {
|
s.student = d.student;
|
||||||
s.active = 0;
|
s.student_name = d.student_name;
|
||||||
|
if (d.active === 0) {
|
||||||
|
s.active = 0;
|
||||||
|
}
|
||||||
|
s.group_roll_number = ++max_roll_no;
|
||||||
}
|
}
|
||||||
s.group_roll_number = ++max_roll_no;
|
});
|
||||||
}
|
refresh_field("students");
|
||||||
});
|
frm.save();
|
||||||
refresh_field("students");
|
} else {
|
||||||
frm.save();
|
frappe.msgprint(__("Student Group is already updated."))
|
||||||
} else {
|
}
|
||||||
frappe.msgprint(__("Student Group is already updated."))
|
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
} else {
|
} else {
|
||||||
frappe.msgprint(__("Select students manually for the Activity based Group"));
|
frappe.msgprint(__("Select students manually for the Activity based Group"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user