fix: Add student category to student applicant (#24779)

* fix: Add student category to student applicant

Student category will be automatically fetched during program
enrollment while importing students into the system.

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>

* fix: Allow student category during program enrollment

Signed-off-by: Syed Mujeer Hashmi <mujeerhashmi@4csolutions.in>
This commit is contained in:
Syed Mujeer Hashmi 2021-03-09 21:04:55 +05:30 committed by GitHub
parent db2d196296
commit ec829786e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -36,6 +36,7 @@ def enroll_student(source_name):
student.save()
program_enrollment = frappe.new_doc("Program Enrollment")
program_enrollment.student = student.name
program_enrollment.student_category = student.student_category
program_enrollment.student_name = student.title
program_enrollment.program = frappe.db.get_value("Student Applicant", source_name, "program")
frappe.publish_realtime('enroll_student_progress', {"progress": [2, 4]}, user=frappe.session.user)

View File

@ -30,7 +30,7 @@ class ProgramEnrollmentTool(Document):
.format(condition), self.as_dict(), as_dict=1)
elif self.get_students_from == "Program Enrollment":
condition2 = 'and student_batch_name=%(student_batch)s' if self.student_batch else " "
students = frappe.db.sql('''select student, student_name, student_batch_name from `tabProgram Enrollment`
students = frappe.db.sql('''select student, student_name, student_batch_name, student_category from `tabProgram Enrollment`
where program=%(program)s and academic_year=%(academic_year)s {0} {1} and docstatus != 2'''
.format(condition, condition2), self.as_dict(), as_dict=1)
@ -57,6 +57,7 @@ class ProgramEnrollmentTool(Document):
prog_enrollment = frappe.new_doc("Program Enrollment")
prog_enrollment.student = stud.student
prog_enrollment.student_name = stud.student_name
prog_enrollment.student_category = stud.student_category
prog_enrollment.program = self.new_program
prog_enrollment.academic_year = self.new_academic_year
prog_enrollment.academic_term = self.new_academic_term

View File

@ -11,6 +11,7 @@
"middle_name",
"last_name",
"program",
"student_category",
"lms_only",
"paid",
"column_break_8",
@ -257,12 +258,18 @@
"options": "Student Applicant",
"print_hide": 1,
"read_only": 1
},
{
"fieldname": "student_category",
"fieldtype": "Link",
"label": "Student Category",
"options": "Student Category"
}
],
"image_field": "image",
"is_submittable": 1,
"links": [],
"modified": "2020-10-05 13:59:45.631647",
"modified": "2021-03-01 23:00:25.119241",
"modified_by": "Administrator",
"module": "Education",
"name": "Student Applicant",