Merge pull request #5839 from saurabh6790/payment_request_demo
Payment request demo
diff --git a/erpnext/schools/doctype/course/course.json b/erpnext/schools/doctype/course/course.json
index f3d82e6..ab73dcb 100644
--- a/erpnext/schools/doctype/course/course.json
+++ b/erpnext/schools/doctype/course/course.json
@@ -9,6 +9,7 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
+ "editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
@@ -64,6 +65,55 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "column_break_3",
+ "fieldtype": "Column Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "course_abbreviation",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Course Abbreviation",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "department",
"fieldtype": "Link",
"hidden": 0,
@@ -90,6 +140,30 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "section_break_6",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "course_intro",
"fieldtype": "Text Editor",
"hidden": 0,
@@ -123,7 +197,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-07-18 10:30:50.243271",
+ "modified": "2016-07-22 06:02:14.586594",
"modified_by": "Administrator",
"module": "Schools",
"name": "Course",
diff --git a/erpnext/schools/doctype/program/program.json b/erpnext/schools/doctype/program/program.json
index 8041f61..279430d 100644
--- a/erpnext/schools/doctype/program/program.json
+++ b/erpnext/schools/doctype/program/program.json
@@ -9,6 +9,7 @@
"docstatus": 0,
"doctype": "DocType",
"document_type": "",
+ "editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
@@ -64,6 +65,31 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
+ "fieldname": "program_abbreviation",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Program Abbreviation",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
"fieldname": "column_break_3",
"fieldtype": "Column Break",
"hidden": 0,
@@ -216,6 +242,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
+ "image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
@@ -223,7 +250,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-07-18 10:30:50.243271",
+ "modified": "2016-07-22 05:35:14.470843",
"modified_by": "Administrator",
"module": "Schools",
"name": "Program",
diff --git a/erpnext/schools/doctype/student_batch/__init__.py b/erpnext/schools/doctype/student_batch/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch/__init__.py
diff --git a/erpnext/schools/doctype/student_batch/student_batch.js b/erpnext/schools/doctype/student_batch/student_batch.js
new file mode 100644
index 0000000..73d4faa
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch/student_batch.js
@@ -0,0 +1,10 @@
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+frappe.ui.form.on('Student Batch', {
+ refresh: function(frm) {
+
+ }
+});
+
+cur_frm.add_fetch("student", "title", "student_name");
diff --git a/erpnext/schools/doctype/student_batch/student_batch.json b/erpnext/schools/doctype/student_batch/student_batch.json
new file mode 100644
index 0000000..f153845
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch/student_batch.json
@@ -0,0 +1,237 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "autoname": "",
+ "beta": 0,
+ "creation": "2016-07-21 15:49:53.776461",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "student_batch_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Student Batch Name",
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "academic_year",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 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,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 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,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "program",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 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,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "academic_term",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Academic Term",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Academic Year",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "section_break_8",
+ "fieldtype": "Section Break",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "students",
+ "fieldtype": "Table",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 0,
+ "label": "Students",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Student Batch Student",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "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-07-22 05:31:12.683404",
+ "modified_by": "Administrator",
+ "module": "Schools",
+ "name": "Student Batch",
+ "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,
+ "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",
+ "title_field": "",
+ "track_seen": 0
+}
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_batch/student_batch.py b/erpnext/schools/doctype/student_batch/student_batch.py
new file mode 100644
index 0000000..7c7568d
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch/student_batch.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
+# For license information, please see license.txt
+
+from __future__ import unicode_literals
+from frappe.model.document import Document
+from erpnext.schools.utils import validate_duplicate_student
+import frappe
+
+class StudentBatch(Document):
+ def validate(self):
+ validate_duplicate_student(self.students)
+ prog_abb = frappe.db.get_value("Program", self.program, "program_abbreviation")
+ if not prog_abb:
+ prog_abb = self.program
+ self.name = prog_abb + "-"+ self.student_batch_name + "-" + self.academic_year
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_batch/test_student_batch.py b/erpnext/schools/doctype/student_batch/test_student_batch.py
new file mode 100644
index 0000000..55796ee
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch/test_student_batch.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('Student Batch')
+
+class TestStudentBatch(unittest.TestCase):
+ pass
diff --git a/erpnext/schools/doctype/student_batch_student/__init__.py b/erpnext/schools/doctype/student_batch_student/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch_student/__init__.py
diff --git a/erpnext/schools/doctype/student_batch_student/student_batch_student.json b/erpnext/schools/doctype/student_batch_student/student_batch_student.json
new file mode 100644
index 0000000..c9b1b01
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch_student/student_batch_student.json
@@ -0,0 +1,113 @@
+{
+ "allow_copy": 0,
+ "allow_import": 0,
+ "allow_rename": 0,
+ "beta": 0,
+ "creation": "2016-07-22 03:27:20.120023",
+ "custom": 0,
+ "docstatus": 0,
+ "doctype": "DocType",
+ "document_type": "",
+ "editable_grid": 1,
+ "fields": [
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "student",
+ "fieldtype": "Link",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Student",
+ "length": 0,
+ "no_copy": 0,
+ "options": "Student",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 1,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 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,
+ "length": 0,
+ "no_copy": 0,
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "unique": 0
+ },
+ {
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "fieldname": "student_name",
+ "fieldtype": "Data",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_list_view": 1,
+ "label": "Student Name",
+ "length": 0,
+ "no_copy": 0,
+ "options": "",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 1,
+ "report_hide": 0,
+ "reqd": 0,
+ "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": 1,
+ "max_attachments": 0,
+ "modified": "2016-07-22 03:27:52.913126",
+ "modified_by": "Administrator",
+ "module": "Schools",
+ "name": "Student Batch Student",
+ "name_case": "",
+ "owner": "Administrator",
+ "permissions": [],
+ "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/student_batch_student/student_batch_student.py b/erpnext/schools/doctype/student_batch_student/student_batch_student.py
new file mode 100644
index 0000000..542f3c4
--- /dev/null
+++ b/erpnext/schools/doctype/student_batch_student/student_batch_student.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 StudentBatchStudent(Document):
+ pass
diff --git a/erpnext/schools/doctype/student_group/student_group.json b/erpnext/schools/doctype/student_group/student_group.json
index 38a7747..b2c1157 100644
--- a/erpnext/schools/doctype/student_group/student_group.json
+++ b/erpnext/schools/doctype/student_group/student_group.json
@@ -2,33 +2,37 @@
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
- "autoname": "field:group_name",
+ "autoname": "",
+ "beta": 0,
"creation": "2015-09-07 12:55:52.072792",
"custom": 0,
"docstatus": 0,
"doctype": "DocType",
"document_type": "Document",
+ "editable_grid": 0,
"fields": [
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
- "fieldname": "group_name",
- "fieldtype": "Data",
+ "fieldname": "student_batch",
+ "fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
- "label": "Group Name",
+ "label": "Student Batch",
"length": 0,
"no_copy": 0,
+ "options": "Student Batch",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
- "reqd": 1,
+ "reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
@@ -41,6 +45,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Academic Term",
@@ -66,6 +71,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Academic Year",
@@ -91,6 +97,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@@ -114,6 +121,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Program",
@@ -139,6 +147,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Course",
@@ -165,6 +174,7 @@
"fieldtype": "Int",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Max Strength",
@@ -190,6 +200,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Students",
@@ -214,6 +225,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Students",
@@ -239,6 +251,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
@@ -259,6 +272,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
+ "image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
@@ -266,7 +280,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
- "modified": "2016-07-18 10:30:50.243271",
+ "modified": "2016-07-22 06:12:10.092544",
"modified_by": "Administrator",
"module": "Schools",
"name": "Student Group",
@@ -314,11 +328,12 @@
"write": 1
}
],
+ "quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "program, course",
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "group_name",
- "version": 0
+ "title_field": "",
+ "track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/schools/doctype/student_group/student_group.py b/erpnext/schools/doctype/student_group/student_group.py
index 0acbed9..3cd9bfb 100644
--- a/erpnext/schools/doctype/student_group/student_group.py
+++ b/erpnext/schools/doctype/student_group/student_group.py
@@ -6,12 +6,32 @@
import frappe
from frappe.model.document import Document
from frappe import _
+from erpnext.schools.utils import validate_duplicate_student
class StudentGroup(Document):
def validate(self):
+ self.set_name()
self.validate_strength()
self.validate_student_name()
-
+ validate_duplicate_student(self.students)
+
+ def set_name(self):
+ self.name = frappe.db.get_value("Course", self.course, "course_abbreviation")
+ if not self.name:
+ self.name = self.course
+ if self.student_batch:
+ self.name += "-" + self.student_batch
+ else:
+ prog_abb = frappe.db.get_value("Program", self.program, "program_abbreviation")
+ if not prog_abb:
+ prog_abb = self.program
+ if prog_abb:
+ self.name += "-" + prog_abb
+ if self.academic_year:
+ self.name += "-" + self.academic_year
+ if self.academic_term:
+ self.name += "-" + self.academic_term
+
def validate_strength(self):
if self.max_strength and len(self.students) > self.max_strength:
frappe.throw(_("""Cannot enroll more than {0} students for this student group.""").format(self.max_strength))
@@ -19,3 +39,5 @@
def validate_student_name(self):
for d in self.students:
d.student_name = frappe.db.get_value("Student", d.student, "title")
+
+
\ No newline at end of file
diff --git a/erpnext/schools/utils.py b/erpnext/schools/utils.py
index c7e92c2..3adbae4 100644
--- a/erpnext/schools/utils.py
+++ b/erpnext/schools/utils.py
@@ -42,3 +42,12 @@
}, as_dict=True)
return existing[0] if existing else None
+
+def validate_duplicate_student(students):
+ unique_students= []
+ for stud in students:
+ if stud.student in unique_students:
+ frappe.throw(_("Student {0} - {1} appears Multiple times in row {2} & {3}")
+ .format(stud.student, stud.student_name, unique_students.index(stud.student)+1, stud.idx))
+ else:
+ unique_students.append(stud.student)