From defdd784f443f5c935b352c68a070540be4f0801 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Thu, 17 Nov 2016 18:52:31 +0530 Subject: [PATCH 1/4] Added Student Batch Name & Batch Creation Tool in Schools Module. --- erpnext/config/schools.py | 27 ++- .../doctype/batch_creation_tool/__init__.py | 0 .../batch_creation_tool.js | 8 + .../batch_creation_tool.json | 176 ++++++++++++++++++ .../batch_creation_tool.py | 26 +++ .../schools/doctype/batch_name/__init__.py | 0 .../schools/doctype/batch_name/batch_name.js | 8 + .../doctype/batch_name/batch_name.json | 89 +++++++++ .../schools/doctype/batch_name/batch_name.py | 10 + .../doctype/batch_name/test_batch_name.py | 12 ++ .../program_enrollment.json | 31 ++- 11 files changed, 381 insertions(+), 6 deletions(-) create mode 100644 erpnext/schools/doctype/batch_creation_tool/__init__.py create mode 100644 erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.js create mode 100644 erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.json create mode 100644 erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.py create mode 100644 erpnext/schools/doctype/batch_name/__init__.py create mode 100644 erpnext/schools/doctype/batch_name/batch_name.js create mode 100644 erpnext/schools/doctype/batch_name/batch_name.json create mode 100644 erpnext/schools/doctype/batch_name/batch_name.py create mode 100644 erpnext/schools/doctype/batch_name/test_batch_name.py diff --git a/erpnext/config/schools.py b/erpnext/config/schools.py index 41a8e71073..688d1189d3 100644 --- a/erpnext/config/schools.py +++ b/erpnext/config/schools.py @@ -48,6 +48,10 @@ def get_data(): { "type": "doctype", "name": "Program Enrollment Tool" + }, + { + "type": "doctype", + "name": "Batch Creation Tool" } ] }, @@ -63,6 +67,19 @@ def get_data(): "type": "doctype", "name": "Student Attendance" }, + { + "type": "doctype", + "name": "Scheduling Tool" + }, + { + "type": "doctype", + "name": "Student Batch Attendance Tool" + } + ] + }, + { + "label": _("Assessment"), + "items": [ { "type": "doctype", "name": "Assessment" @@ -73,11 +90,7 @@ def get_data(): }, { "type": "doctype", - "name": "Student Batch Attendance Tool" - }, - { - "type": "doctype", - "name": "Scheduling Tool" + "name": "Grading Structure" } ] }, @@ -132,6 +145,10 @@ def get_data(): "type": "doctype", "name": "Program" }, + { + "type": "doctype", + "name": "Student Batch Name" + }, { "type": "doctype", "name": "Student Category" diff --git a/erpnext/schools/doctype/batch_creation_tool/__init__.py b/erpnext/schools/doctype/batch_creation_tool/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.js b/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.js new file mode 100644 index 0000000000..2ab638fbdb --- /dev/null +++ b/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.js @@ -0,0 +1,8 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Batch Creation Tool', { + refresh: function(frm) { + frm.disable_save(); + } +}); diff --git a/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.json b/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.json new file mode 100644 index 0000000000..01769cad8a --- /dev/null +++ b/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.json @@ -0,0 +1,176 @@ +{ + "allow_copy": 1, + "allow_import": 0, + "allow_rename": 0, + "beta": 0, + "creation": "2016-11-14 18:20:12.160405", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "academic_year", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Academic Year", + "length": 0, + "no_copy": 0, + "options": "Academic Year", + "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": "program", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Program", + "length": 0, + "no_copy": 0, + "options": "Program", + "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_batch_name", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Student Batch Name", + "length": 0, + "no_copy": 0, + "options": "Student Batch Name", + "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": "make_student_batch", + "fieldtype": "Button", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Make Student Batch", + "length": 0, + "no_copy": 0, + "options": "make_batch", + "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 + } + ], + "hide_heading": 1, + "hide_toolbar": 1, + "idx": 0, + "image_view": 0, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 1, + "istable": 0, + "max_attachments": 0, + "modified": "2016-11-18 17:33:03.157470", + "modified_by": "Administrator", + "module": "Schools", + "name": "Batch Creation Tool", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "export": 0, + "if_owner": 0, + "import": 0, + "is_custom": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Academics User", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 0, + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.py b/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.py new file mode 100644 index 0000000000..accc65e1ed --- /dev/null +++ b/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class BatchCreationTool(Document): + def make_batch(self): + if self.academic_year and self.program and self.student_batch_name: + students = frappe.get_list("Program Enrollment", fields=["student", "student_name"], + filters={"academic_year":self.academic_year, "program": self.program, "student_batch_name": self.student_batch_name}, + order_by= "student_name") + if students: + student_batch = frappe.new_doc("Student Batch") + student_batch.update({ + "academic_year": self.academic_year, + "program": self.program, + "student_batch_name": self.student_batch_name, + "students": students + }) + student_batch.save() + frappe.msgprint("Student Batch created.") + else: + frappe.msgprint("No students found.") diff --git a/erpnext/schools/doctype/batch_name/__init__.py b/erpnext/schools/doctype/batch_name/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/schools/doctype/batch_name/batch_name.js b/erpnext/schools/doctype/batch_name/batch_name.js new file mode 100644 index 0000000000..d1ef7b65d1 --- /dev/null +++ b/erpnext/schools/doctype/batch_name/batch_name.js @@ -0,0 +1,8 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on('Batch Name', { + refresh: function(frm) { + + } +}); diff --git a/erpnext/schools/doctype/batch_name/batch_name.json b/erpnext/schools/doctype/batch_name/batch_name.json new file mode 100644 index 0000000000..d5012c46ee --- /dev/null +++ b/erpnext/schools/doctype/batch_name/batch_name.json @@ -0,0 +1,89 @@ +{ + "allow_copy": 0, + "allow_import": 0, + "allow_rename": 0, + "autoname": "field:batch_name", + "beta": 0, + "creation": "2016-11-17 18:45:57.965091", + "custom": 0, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Setup", + "editable_grid": 1, + "engine": "InnoDB", + "fields": [ + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "batch_name", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Batch Name", + "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": 1, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 0, + "image_view": 0, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 0, + "issingle": 0, + "istable": 0, + "max_attachments": 0, + "modified": "2016-11-17 18:46:01.359799", + "modified_by": "Administrator", + "module": "Schools", + "name": "Batch Name", + "name_case": "", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "is_custom": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Academics User", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + } + ], + "quick_entry": 1, + "read_only": 0, + "read_only_onload": 0, + "sort_field": "modified", + "sort_order": "DESC", + "track_seen": 0 +} \ No newline at end of file diff --git a/erpnext/schools/doctype/batch_name/batch_name.py b/erpnext/schools/doctype/batch_name/batch_name.py new file mode 100644 index 0000000000..6776b71568 --- /dev/null +++ b/erpnext/schools/doctype/batch_name/batch_name.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.document import Document + +class BatchName(Document): + pass diff --git a/erpnext/schools/doctype/batch_name/test_batch_name.py b/erpnext/schools/doctype/batch_name/test_batch_name.py new file mode 100644 index 0000000000..ecb0c4bce3 --- /dev/null +++ b/erpnext/schools/doctype/batch_name/test_batch_name.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt +from __future__ import unicode_literals + +import frappe +import unittest + +# test_records = frappe.get_test_records('Batch Name') + +class TestBatchName(unittest.TestCase): + pass diff --git a/erpnext/schools/doctype/program_enrollment/program_enrollment.json b/erpnext/schools/doctype/program_enrollment/program_enrollment.json index 8fed22884b..e7269f010c 100644 --- a/erpnext/schools/doctype/program_enrollment/program_enrollment.json +++ b/erpnext/schools/doctype/program_enrollment/program_enrollment.json @@ -99,6 +99,35 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "student_batch_name", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Student Batch Name", + "length": 0, + "no_copy": 0, + "options": "Student Batch Name", + "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, @@ -340,7 +369,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-11-07 05:25:17.473070", + "modified": "2016-11-18 14:20:10.023790", "modified_by": "Administrator", "module": "Schools", "name": "Program Enrollment", From 6566431fc525e7c6e9161ded052d5e26c6ec839e Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Fri, 18 Nov 2016 17:49:27 +0530 Subject: [PATCH 2/4] Rearranged scheduling Tool --- .../scheduling_tool/scheduling_tool.json | 114 +++++++++--------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/erpnext/schools/doctype/scheduling_tool/scheduling_tool.json b/erpnext/schools/doctype/scheduling_tool/scheduling_tool.json index cf2c1a3d11..233e8a310b 100644 --- a/erpnext/schools/doctype/scheduling_tool/scheduling_tool.json +++ b/erpnext/schools/doctype/scheduling_tool/scheduling_tool.json @@ -239,62 +239,6 @@ "set_only_once": 0, "unique": 0 }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "room", - "fieldtype": "Link", - "hidden": 0, - "ignore_user_permissions": 0, - "ignore_xss_filter": 0, - "in_filter": 0, - "in_list_view": 0, - "in_standard_filter": 0, - "label": "Room", - "length": 0, - "no_copy": 0, - "options": "Room", - "permlevel": 0, - "precision": "", - "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, - "set_only_once": 0, - "unique": 0 - }, - { - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "column_break_9", - "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, @@ -353,6 +297,62 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_9", + "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": "room", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Room", + "length": 0, + "no_copy": 0, + "options": "Room", + "permlevel": 0, + "precision": "", + "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, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -592,7 +592,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-11-16 16:03:41.854229", + "modified": "2016-11-18 17:48:40.610284", "modified_by": "Administrator", "module": "Schools", "name": "Scheduling Tool", From b444d5d81b95af9f3946da2d40fd02f8c8b09b06 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Mon, 21 Nov 2016 17:04:23 +0530 Subject: [PATCH 3/4] Rename Scheduling Tool to Course scheduling Tool, Batch Name to Student Batch Name and Batch Creation tool to Student Batch Creation tool --- erpnext/config/schools.py | 20 ++++++++----------- .../__init__.py | 0 .../course_scheduling_tool.js} | 5 ++++- .../course_scheduling_tool.json} | 4 ++-- .../course_scheduling_tool.py} | 5 +++-- .../scheduling_tool/test_scheduling_tool.py | 12 ----------- .../doctype/student_batch/student_batch.json | 5 +++-- .../__init__.py | 0 .../student_batch_creation_tool.js} | 2 +- .../student_batch_creation_tool.json} | 4 ++-- .../student_batch_creation_tool.py} | 3 ++- .../__init__.py | 0 .../student_batch_name.js} | 2 +- .../student_batch_name.json} | 4 ++-- .../student_batch_name.py} | 2 +- .../test_student_batch_name.py} | 4 ++-- 16 files changed, 31 insertions(+), 41 deletions(-) rename erpnext/schools/doctype/{batch_creation_tool => course_scheduling_tool}/__init__.py (100%) rename erpnext/schools/doctype/{scheduling_tool/scheduling_tool.js => course_scheduling_tool/course_scheduling_tool.js} (71%) rename erpnext/schools/doctype/{scheduling_tool/scheduling_tool.json => course_scheduling_tool/course_scheduling_tool.json} (99%) rename erpnext/schools/doctype/{scheduling_tool/scheduling_tool.py => course_scheduling_tool/course_scheduling_tool.py} (97%) delete mode 100644 erpnext/schools/doctype/scheduling_tool/test_scheduling_tool.py rename erpnext/schools/doctype/{batch_name => student_batch_creation_tool}/__init__.py (100%) rename erpnext/schools/doctype/{batch_creation_tool/batch_creation_tool.js => student_batch_creation_tool/student_batch_creation_tool.js} (77%) rename erpnext/schools/doctype/{batch_creation_tool/batch_creation_tool.json => student_batch_creation_tool/student_batch_creation_tool.json} (97%) rename erpnext/schools/doctype/{batch_creation_tool/batch_creation_tool.py => student_batch_creation_tool/student_batch_creation_tool.py} (95%) rename erpnext/schools/doctype/{scheduling_tool => student_batch_name}/__init__.py (100%) rename erpnext/schools/doctype/{batch_name/batch_name.js => student_batch_name/student_batch_name.js} (78%) rename erpnext/schools/doctype/{batch_name/batch_name.json => student_batch_name/student_batch_name.json} (95%) rename erpnext/schools/doctype/{batch_name/batch_name.py => student_batch_name/student_batch_name.py} (87%) rename erpnext/schools/doctype/{batch_name/test_batch_name.py => student_batch_name/test_student_batch_name.py} (63%) diff --git a/erpnext/config/schools.py b/erpnext/config/schools.py index 688d1189d3..7a415f013d 100644 --- a/erpnext/config/schools.py +++ b/erpnext/config/schools.py @@ -51,7 +51,7 @@ def get_data(): }, { "type": "doctype", - "name": "Batch Creation Tool" + "name": "Student Batch Creation Tool" } ] }, @@ -69,7 +69,7 @@ def get_data(): }, { "type": "doctype", - "name": "Scheduling Tool" + "name": "Course Scheduling Tool" }, { "type": "doctype", @@ -147,7 +147,11 @@ def get_data(): }, { "type": "doctype", - "name": "Student Batch Name" + "name": "Instructor" + }, + { + "type": "doctype", + "name": "Room" }, { "type": "doctype", @@ -155,15 +159,7 @@ def get_data(): }, { "type": "doctype", - "name": "Grading Structure" - }, - { - "type": "doctype", - "name": "Instructor" - }, - { - "type": "doctype", - "name": "Room" + "name": "Student Batch Name" }, { "type": "doctype", diff --git a/erpnext/schools/doctype/batch_creation_tool/__init__.py b/erpnext/schools/doctype/course_scheduling_tool/__init__.py similarity index 100% rename from erpnext/schools/doctype/batch_creation_tool/__init__.py rename to erpnext/schools/doctype/course_scheduling_tool/__init__.py diff --git a/erpnext/schools/doctype/scheduling_tool/scheduling_tool.js b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js similarity index 71% rename from erpnext/schools/doctype/scheduling_tool/scheduling_tool.js rename to erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js index 50113752df..b8d4562b8d 100644 --- a/erpnext/schools/doctype/scheduling_tool/scheduling_tool.js +++ b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.js @@ -1,10 +1,13 @@ +// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + cur_frm.add_fetch("student_group", "program", "program"); cur_frm.add_fetch("student_group", "student_batch", "student_batch"); cur_frm.add_fetch("student_group", "course", "course"); cur_frm.add_fetch("student_group", "academic_year", "academic_year"); cur_frm.add_fetch("student_group", "academic_term", "academic_term"); -frappe.ui.form.on("Scheduling Tool", "refresh", function(frm) { +frappe.ui.form.on("Course Scheduling Tool", "refresh", function(frm) { frm.disable_save(); frm.page.set_primary_action(__("Schedule Course"), function() { frappe.call({ diff --git a/erpnext/schools/doctype/scheduling_tool/scheduling_tool.json b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json similarity index 99% rename from erpnext/schools/doctype/scheduling_tool/scheduling_tool.json rename to erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json index 233e8a310b..a66960ef0a 100644 --- a/erpnext/schools/doctype/scheduling_tool/scheduling_tool.json +++ b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.json @@ -592,10 +592,10 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-11-18 17:48:40.610284", + "modified": "2016-11-21 16:58:29.295922", "modified_by": "Administrator", "module": "Schools", - "name": "Scheduling Tool", + "name": "Course Scheduling Tool", "name_case": "", "owner": "Administrator", "permissions": [ diff --git a/erpnext/schools/doctype/scheduling_tool/scheduling_tool.py b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py similarity index 97% rename from erpnext/schools/doctype/scheduling_tool/scheduling_tool.py rename to erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py index b8ba578077..86fefe20cc 100644 --- a/erpnext/schools/doctype/scheduling_tool/scheduling_tool.py +++ b/erpnext/schools/doctype/course_scheduling_tool/course_scheduling_tool.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (c) 2015, Frappe Technologies and contributors +# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals @@ -10,7 +10,7 @@ from frappe.model.document import Document from frappe.utils import add_days, getdate from erpnext.schools.utils import OverlapError -class SchedulingTool(Document): +class CourseSchedulingTool(Document): def schedule_course(self): """Creates course schedules as per specified parametes""" @@ -102,3 +102,4 @@ class SchedulingTool(Document): course_schedule.from_time= self.from_time course_schedule.to_time= self.to_time return course_schedule + diff --git a/erpnext/schools/doctype/scheduling_tool/test_scheduling_tool.py b/erpnext/schools/doctype/scheduling_tool/test_scheduling_tool.py deleted file mode 100644 index 4ec3747b80..0000000000 --- a/erpnext/schools/doctype/scheduling_tool/test_scheduling_tool.py +++ /dev/null @@ -1,12 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright (c) 2015, Frappe and Contributors -# See license.txt -from __future__ import unicode_literals - -import frappe -import unittest - -# test_records = frappe.get_test_records('Scheduling Tool') - -class TestSchedulingTool(unittest.TestCase): - pass diff --git a/erpnext/schools/doctype/student_batch/student_batch.json b/erpnext/schools/doctype/student_batch/student_batch.json index 1e529d7dd1..e674bbb2a0 100644 --- a/erpnext/schools/doctype/student_batch/student_batch.json +++ b/erpnext/schools/doctype/student_batch/student_batch.json @@ -18,7 +18,7 @@ "collapsible": 0, "columns": 0, "fieldname": "student_batch_name", - "fieldtype": "Data", + "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -28,6 +28,7 @@ "label": "Student Batch Name", "length": 0, "no_copy": 0, + "options": "Student Batch Name", "permlevel": 0, "precision": "", "print_hide": 0, @@ -221,7 +222,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-11-07 05:59:36.920495", + "modified": "2016-11-21 16:52:23.939904", "modified_by": "Administrator", "module": "Schools", "name": "Student Batch", diff --git a/erpnext/schools/doctype/batch_name/__init__.py b/erpnext/schools/doctype/student_batch_creation_tool/__init__.py similarity index 100% rename from erpnext/schools/doctype/batch_name/__init__.py rename to erpnext/schools/doctype/student_batch_creation_tool/__init__.py diff --git a/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.js b/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.js similarity index 77% rename from erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.js rename to erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.js index 2ab638fbdb..316717450f 100644 --- a/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.js +++ b/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.js @@ -1,7 +1,7 @@ // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt -frappe.ui.form.on('Batch Creation Tool', { +frappe.ui.form.on('Student Batch Creation Tool', { refresh: function(frm) { frm.disable_save(); } diff --git a/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.json b/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.json similarity index 97% rename from erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.json rename to erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.json index 01769cad8a..d94c4808fb 100644 --- a/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.json +++ b/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.json @@ -138,10 +138,10 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2016-11-18 17:33:03.157470", + "modified": "2016-11-21 16:47:56.823988", "modified_by": "Administrator", "module": "Schools", - "name": "Batch Creation Tool", + "name": "Student Batch Creation Tool", "name_case": "", "owner": "Administrator", "permissions": [ diff --git a/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.py b/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.py similarity index 95% rename from erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.py rename to erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.py index accc65e1ed..deda1373d9 100644 --- a/erpnext/schools/doctype/batch_creation_tool/batch_creation_tool.py +++ b/erpnext/schools/doctype/student_batch_creation_tool/student_batch_creation_tool.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document -class BatchCreationTool(Document): +class StudentBatchCreationTool(Document): def make_batch(self): if self.academic_year and self.program and self.student_batch_name: students = frappe.get_list("Program Enrollment", fields=["student", "student_name"], @@ -24,3 +24,4 @@ class BatchCreationTool(Document): frappe.msgprint("Student Batch created.") else: frappe.msgprint("No students found.") + diff --git a/erpnext/schools/doctype/scheduling_tool/__init__.py b/erpnext/schools/doctype/student_batch_name/__init__.py similarity index 100% rename from erpnext/schools/doctype/scheduling_tool/__init__.py rename to erpnext/schools/doctype/student_batch_name/__init__.py diff --git a/erpnext/schools/doctype/batch_name/batch_name.js b/erpnext/schools/doctype/student_batch_name/student_batch_name.js similarity index 78% rename from erpnext/schools/doctype/batch_name/batch_name.js rename to erpnext/schools/doctype/student_batch_name/student_batch_name.js index d1ef7b65d1..7ed3021fb4 100644 --- a/erpnext/schools/doctype/batch_name/batch_name.js +++ b/erpnext/schools/doctype/student_batch_name/student_batch_name.js @@ -1,7 +1,7 @@ // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt -frappe.ui.form.on('Batch Name', { +frappe.ui.form.on('Student Batch Name', { refresh: function(frm) { } diff --git a/erpnext/schools/doctype/batch_name/batch_name.json b/erpnext/schools/doctype/student_batch_name/student_batch_name.json similarity index 95% rename from erpnext/schools/doctype/batch_name/batch_name.json rename to erpnext/schools/doctype/student_batch_name/student_batch_name.json index d5012c46ee..7f5f16d913 100644 --- a/erpnext/schools/doctype/batch_name/batch_name.json +++ b/erpnext/schools/doctype/student_batch_name/student_batch_name.json @@ -51,10 +51,10 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-11-17 18:46:01.359799", + "modified": "2016-11-21 16:31:50.775958", "modified_by": "Administrator", "module": "Schools", - "name": "Batch Name", + "name": "Student Batch Name", "name_case": "", "owner": "Administrator", "permissions": [ diff --git a/erpnext/schools/doctype/batch_name/batch_name.py b/erpnext/schools/doctype/student_batch_name/student_batch_name.py similarity index 87% rename from erpnext/schools/doctype/batch_name/batch_name.py rename to erpnext/schools/doctype/student_batch_name/student_batch_name.py index 6776b71568..e6d38ea254 100644 --- a/erpnext/schools/doctype/batch_name/batch_name.py +++ b/erpnext/schools/doctype/student_batch_name/student_batch_name.py @@ -6,5 +6,5 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document -class BatchName(Document): +class StudentBatchName(Document): pass diff --git a/erpnext/schools/doctype/batch_name/test_batch_name.py b/erpnext/schools/doctype/student_batch_name/test_student_batch_name.py similarity index 63% rename from erpnext/schools/doctype/batch_name/test_batch_name.py rename to erpnext/schools/doctype/student_batch_name/test_student_batch_name.py index ecb0c4bce3..09534f355c 100644 --- a/erpnext/schools/doctype/batch_name/test_batch_name.py +++ b/erpnext/schools/doctype/student_batch_name/test_student_batch_name.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import frappe import unittest -# test_records = frappe.get_test_records('Batch Name') +# test_records = frappe.get_test_records('Student Batch Name') -class TestBatchName(unittest.TestCase): +class TestStudentBatchName(unittest.TestCase): pass From f89ffdb57a218c1ea75ddfa82263371d67f56344 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Mon, 21 Nov 2016 18:32:40 +0530 Subject: [PATCH 4/4] Fixes for student Attendance --- .../schools/doctype/student_attendance/student_attendance.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.py b/erpnext/schools/doctype/student_attendance/student_attendance.py index d9949b0850..45b3014579 100644 --- a/erpnext/schools/doctype/student_attendance/student_attendance.py +++ b/erpnext/schools/doctype/student_attendance/student_attendance.py @@ -31,7 +31,8 @@ class StudentAttendance(Document): (self.student, self.course_schedule, self.name)) else: attendance_records= frappe.db.sql("""select name from `tabStudent Attendance` where \ - student= %s and date= %s and name != %s and course_schedule='' and docstatus=1""", + student= %s and date= %s and name != %s and docstatus=1 and \ + (course_schedule is Null or course_schedule='')""", (self.student, self.date, self.name)) if attendance_records: