Added ability to disable a student in student group/studnet batch

This commit is contained in:
Neil Trini Lasrado 2017-01-20 19:16:39 +05:30
parent c81621d3ce
commit 16d40cf0a3
6 changed files with 102 additions and 13 deletions

View File

@ -364,4 +364,5 @@ erpnext.patches.v7_2.update_assessment_modules
erpnext.patches.v7_2.update_doctype_status
erpnext.patches.v7_2.update_salary_slips
erpnext.patches.v7_2.delete_fleet_management_module_def
erpnext.patches.v7_2.contact_address_links
erpnext.patches.v7_2.contact_address_links
erpnext.patches.v7_2.mark_students_active

View File

@ -0,0 +1,7 @@
import frappe
def execute():
frappe.reload_doc('schools', 'doctype', 'student_batch_student')
frappe.reload_doc('schools', 'doctype', 'student_group_student')
frappe.db.sql("update `tabStudent Batch Student` set active=1")
frappe.db.sql("update `tabStudent Group Student` set active=1")

View File

@ -88,7 +88,8 @@ def get_student_batch_students(student_batch):
:param student_batch: Student Batch.
"""
students = frappe.get_list("Student Batch Student", fields=["student", "student_name", "idx"] , filters={"parent": student_batch}, order_by= "idx")
students = frappe.get_list("Student Batch Student", fields=["student", "student_name", "idx"] ,
filters={"parent": student_batch, "active": 1}, order_by= "idx")
return students
@frappe.whitelist()
@ -97,7 +98,8 @@ def get_student_group_students(student_group):
:param student_group: Student Group.
"""
students = frappe.get_list("Student Group Student", fields=["student", "student_name"] , filters={"parent": student_group}, order_by= "idx")
students = frappe.get_list("Student Group Student", fields=["student", "student_name"] ,
filters={"parent": student_group, "active": 1}, order_by= "idx")
return students
@frappe.whitelist()

View File

@ -18,11 +18,12 @@ def get_student_attendance_records(based_on, date=None, student_batch=None, cour
student_group = frappe.db.get_value("Course Schedule", course_schedule, "student_group")
if student_group:
student_list = frappe.get_list("Student Group Student", fields=["student", "student_name", "idx"] , \
filters={"parent": student_group}, order_by= "idx")
filters={"parent": student_group, "active": 1}, order_by= "idx")
else:
student_batch = frappe.db.get_value("Course Schedule", course_schedule, "student_batch")
if not student_list:
student_list = frappe.get_list("Student Batch Student", fields=["student", "student_name", "idx"] , filters={"parent": student_batch}, order_by= "idx")
student_list = frappe.get_list("Student Batch Student", fields=["student", "student_name", "idx"] ,
filters={"parent": student_batch, "active": 1}, order_by= "idx")
if course_schedule:
student_attendance_list= frappe.db.sql("""select student, status from `tabStudent Attendance` where \

View File

@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "student",
"fieldtype": "Link",
"hidden": 0,
@ -21,6 +22,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Student",
"length": 0,
"no_copy": 0,
@ -30,6 +32,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -40,13 +43,17 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"columns": 0,
"default": "1",
"fieldname": "active",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Active",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -54,6 +61,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -64,6 +72,34 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "student_name",
"fieldtype": "Data",
"hidden": 0,
@ -71,6 +107,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Student Name",
"length": 0,
"no_copy": 0,
@ -80,6 +117,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -97,8 +135,8 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-22 03:27:52.913126",
"modified_by": "Administrator",
"modified": "2017-01-20 18:26:51.242924",
"modified_by": "neil@frappe.io",
"module": "Schools",
"name": "Student Batch Student",
"name_case": "",
@ -109,5 +147,6 @@
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0
}

View File

@ -14,6 +14,7 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "student",
"fieldtype": "Link",
"hidden": 0,
@ -21,6 +22,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Student",
"length": 0,
"no_copy": 0,
@ -30,6 +32,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 1,
"search_index": 0,
@ -40,13 +43,17 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"columns": 0,
"default": "1",
"fieldname": "active",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "Active",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -54,6 +61,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -64,6 +72,34 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "column_break_2",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "student_name",
"fieldtype": "Data",
"hidden": 0,
@ -71,6 +107,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Student Name",
"length": 0,
"no_copy": 0,
@ -79,6 +116,7 @@
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
@ -96,8 +134,8 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2016-07-21 12:27:02.479077",
"modified_by": "Administrator",
"modified": "2017-01-20 19:11:16.837202",
"modified_by": "neil@frappe.io",
"module": "Schools",
"name": "Student Group Student",
"name_case": "",
@ -108,5 +146,6 @@
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"track_changes": 0,
"track_seen": 0
}