')
- .appendTo(frm.fields_dict.students_html.wrapper);
- },
- onload: function(frm) {
- frm.set_query("student_group", function() {
- return {
- "filters": {
- "group_based_on": frm.doc.group_based_on,
- "disabled": 0
- }
- };
- });
- },
-
- refresh: function(frm) {
- if (frappe.route_options) {
- frm.set_value("based_on", frappe.route_options.based_on);
- frm.set_value("student_group", frappe.route_options.student_group);
- frm.set_value("course_schedule", frappe.route_options.course_schedule);
- frappe.route_options = null;
- }
- frm.disable_save();
- },
-
- based_on: function(frm) {
- if (frm.doc.based_on == "Student Group") {
- frm.set_value("course_schedule", "");
- } else {
- frm.set_value("student_group", "");
- }
- },
-
- student_group: function(frm) {
- if ((frm.doc.student_group && frm.doc.date) || frm.doc.course_schedule) {
- frm.students_area.find('.student-attendance-checks').html(`
Fetching...
`);
- var method = "erpnext.education.doctype.student_attendance_tool.student_attendance_tool.get_student_attendance_records";
-
- frappe.call({
- method: method,
- args: {
- based_on: frm.doc.based_on,
- student_group: frm.doc.student_group,
- date: frm.doc.date,
- course_schedule: frm.doc.course_schedule
- },
- callback: function(r) {
- frm.events.get_students(frm, r.message);
- }
- })
- }
- },
-
- date: function(frm) {
- if (frm.doc.date > frappe.datetime.get_today())
- frappe.throw(__("Cannot mark attendance for future dates."));
- frm.trigger("student_group");
- },
-
- course_schedule: function(frm) {
- frm.trigger("student_group");
- },
-
- get_students: function(frm, students) {
- students = students || [];
- frm.students_editor = new education.StudentsEditor(frm, frm.students_area, students);
- }
-});
-
-
-education.StudentsEditor = class StudentsEditor {
- constructor(frm, wrapper, students) {
- this.wrapper = wrapper;
- this.frm = frm;
- if(students.length > 0) {
- this.make(frm, students);
- } else {
- this.show_empty_state();
- }
- }
- make(frm, students) {
- var me = this;
-
- $(this.wrapper).empty();
- var student_toolbar = $('
\
- \
- \
-
').appendTo($(this.wrapper));
-
- student_toolbar.find(".btn-add")
- .html(__('Check all'))
- .on("click", function() {
- $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
- if (!$(check).prop("disabled")) {
- check.checked = true;
- }
- });
- });
-
- student_toolbar.find(".btn-remove")
- .html(__('Uncheck all'))
- .on("click", function() {
- $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
- if (!$(check).prop("disabled")) {
- check.checked = false;
- }
- });
- });
-
- student_toolbar.find(".btn-mark-att")
- .html(__('Mark Attendance'))
- .on("click", function() {
- $(me.wrapper.find(".btn-mark-att")).attr("disabled", true);
- var studs = [];
- $(me.wrapper.find('input[type="checkbox"]')).each(function(i, check) {
- var $check = $(check);
- studs.push({
- student: $check.data().student,
- student_name: $check.data().studentName,
- group_roll_number: $check.data().group_roll_number,
- disabled: $check.prop("disabled"),
- checked: $check.is(":checked")
- });
- });
-
- var students_present = studs.filter(function(stud) {
- return !stud.disabled && stud.checked;
- });
-
- var students_absent = studs.filter(function(stud) {
- return !stud.disabled && !stud.checked;
- });
-
- frappe.confirm(__("Do you want to update attendance?
Present: {0}
Absent: {1}",
- [students_present.length, students_absent.length]),
- function() { //ifyes
- if(!frappe.request.ajax_count) {
- frappe.call({
- method: "erpnext.education.api.mark_attendance",
- freeze: true,
- freeze_message: __("Marking attendance"),
- args: {
- "students_present": students_present,
- "students_absent": students_absent,
- "student_group": frm.doc.student_group,
- "course_schedule": frm.doc.course_schedule,
- "date": frm.doc.date
- },
- callback: function(r) {
- $(me.wrapper.find(".btn-mark-att")).attr("disabled", false);
- frm.trigger("student_group");
- }
- });
- }
- },
- function() { //ifno
- $(me.wrapper.find(".btn-mark-att")).attr("disabled", false);
- }
- );
- });
-
- // make html grid of students
- let student_html = '';
- for (let student of students) {
- student_html += `
-
-
-
- ${student.group_roll_number} - ${student.student_name}
-
-
-
`;
- }
-
- $(`
${student_html}
`).appendTo(me.wrapper);
- }
-
- show_empty_state() {
- $(this.wrapper).html(
- `
- ${__("No Students in")} ${this.frm.doc.student_group}
-
`
- );
- }
-};
diff --git a/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.json b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.json
deleted file mode 100644
index ee8f4842a37e..000000000000
--- a/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.json
+++ /dev/null
@@ -1,118 +0,0 @@
-{
- "actions": [],
- "allow_copy": 1,
- "creation": "2016-11-16 17:12:46.437539",
- "doctype": "DocType",
- "editable_grid": 1,
- "engine": "InnoDB",
- "field_order": [
- "based_on",
- "group_based_on",
- "column_break_2",
- "student_group",
- "academic_year",
- "academic_term",
- "course_schedule",
- "date",
- "attendance",
- "students_html"
- ],
- "fields": [
- {
- "fieldname": "based_on",
- "fieldtype": "Select",
- "label": "Based On",
- "options": "Student Group\nCourse Schedule"
- },
- {
- "default": "Batch",
- "depends_on": "eval:doc.based_on == \"Student Group\"",
- "fieldname": "group_based_on",
- "fieldtype": "Select",
- "label": "Group Based On",
- "options": "Batch\nCourse\nActivity"
- },
- {
- "fieldname": "column_break_2",
- "fieldtype": "Column Break"
- },
- {
- "depends_on": "eval:doc.based_on ==\"Student Group\"",
- "fieldname": "student_group",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Student Group",
- "options": "Student Group",
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.based_on ==\"Course Schedule\"",
- "fieldname": "course_schedule",
- "fieldtype": "Link",
- "in_list_view": 1,
- "label": "Course Schedule",
- "options": "Course Schedule",
- "reqd": 1
- },
- {
- "depends_on": "eval:doc.based_on ==\"Student Group\"",
- "fieldname": "date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "Date",
- "reqd": 1
- },
- {
- "depends_on": "eval: (doc.course_schedule \n|| (doc.student_group && doc.date))",
- "fieldname": "attendance",
- "fieldtype": "Section Break",
- "label": "Attendance"
- },
- {
- "fieldname": "students_html",
- "fieldtype": "HTML",
- "label": "Students HTML"
- },
- {
- "fetch_from": "student_group.academic_year",
- "fieldname": "academic_year",
- "fieldtype": "Link",
- "label": "Academic Year",
- "options": "Academic Year",
- "read_only": 1
- },
- {
- "fetch_from": "student_group.academic_term",
- "fieldname": "academic_term",
- "fieldtype": "Link",
- "label": "Academic Term",
- "options": "Academic Term",
- "read_only": 1
- }
- ],
- "hide_toolbar": 1,
- "issingle": 1,
- "links": [],
- "modified": "2020-10-23 17:52:28.078971",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Attendance Tool",
- "owner": "Administrator",
- "permissions": [
- {
- "create": 1,
- "read": 1,
- "role": "Instructor",
- "write": 1
- },
- {
- "create": 1,
- "read": 1,
- "role": "Academics User",
- "write": 1
- }
- ],
- "restrict_to_domain": "Education",
- "sort_field": "modified",
- "sort_order": "DESC"
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.py b/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.py
deleted file mode 100644
index c626a0f288f0..000000000000
--- a/erpnext/education/doctype/student_attendance_tool/student_attendance_tool.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-import frappe
-from frappe.model.document import Document
-
-
-class StudentAttendanceTool(Document):
- pass
-
-
-@frappe.whitelist()
-def get_student_attendance_records(based_on, date=None, student_group=None, course_schedule=None):
- student_list = []
- student_attendance_list = []
-
- if based_on == "Course Schedule":
- student_group = frappe.db.get_value("Course Schedule", course_schedule, "student_group")
- if student_group:
- student_list = frappe.get_all(
- "Student Group Student",
- fields=["student", "student_name", "group_roll_number"],
- filters={"parent": student_group, "active": 1},
- order_by="group_roll_number",
- )
-
- if not student_list:
- student_list = frappe.get_all(
- "Student Group Student",
- fields=["student", "student_name", "group_roll_number"],
- filters={"parent": student_group, "active": 1},
- order_by="group_roll_number",
- )
-
- StudentAttendance = frappe.qb.DocType("Student Attendance")
-
- if course_schedule:
- student_attendance_list = (
- frappe.qb.from_(StudentAttendance)
- .select(StudentAttendance.student, StudentAttendance.status)
- .where((StudentAttendance.course_schedule == course_schedule))
- ).run(as_dict=True)
- else:
- student_attendance_list = (
- frappe.qb.from_(StudentAttendance)
- .select(StudentAttendance.student, StudentAttendance.status)
- .where(
- (StudentAttendance.student_group == student_group)
- & (StudentAttendance.date == date)
- & ((StudentAttendance.course_schedule == "") | (StudentAttendance.course_schedule.isnull()))
- )
- ).run(as_dict=True)
-
- for attendance in student_attendance_list:
- for student in student_list:
- if student.student == attendance.student:
- student.status = attendance.status
-
- return student_list
diff --git a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py b/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py
deleted file mode 100644
index c15036fe0314..000000000000
--- a/erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-
-class TestStudentAttendanceTool(unittest.TestCase):
- pass
diff --git a/erpnext/education/doctype/student_batch_name/__init__.py b/erpnext/education/doctype/student_batch_name/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_batch_name/student_batch_name.js b/erpnext/education/doctype/student_batch_name/student_batch_name.js
deleted file mode 100644
index 7ed3021fb419..000000000000
--- a/erpnext/education/doctype/student_batch_name/student_batch_name.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Student Batch Name', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/education/doctype/student_batch_name/student_batch_name.json b/erpnext/education/doctype/student_batch_name/student_batch_name.json
deleted file mode 100644
index abb643601019..000000000000
--- a/erpnext/education/doctype/student_batch_name/student_batch_name.json
+++ /dev/null
@@ -1,94 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 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_bulk_edit": 0,
- "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_global_search": 0,
- "in_list_view": 1,
- "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
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2017-11-10 19:08:17.980349",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student 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,
- "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,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 0,
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_batch_name/student_batch_name.py b/erpnext/education/doctype/student_batch_name/student_batch_name.py
deleted file mode 100644
index ae59291dcf7b..000000000000
--- a/erpnext/education/doctype/student_batch_name/student_batch_name.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentBatchName(Document):
- pass
diff --git a/erpnext/education/doctype/student_batch_name/test_records.json b/erpnext/education/doctype/student_batch_name/test_records.json
deleted file mode 100644
index bf365c638a8c..000000000000
--- a/erpnext/education/doctype/student_batch_name/test_records.json
+++ /dev/null
@@ -1,8 +0,0 @@
-[
- {
- "batch_name": "_Batch 1"
- },
- {
- "batch_name": "_Batch 2"
- }
-]
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_batch_name/test_student_batch_name.py b/erpnext/education/doctype/student_batch_name/test_student_batch_name.py
deleted file mode 100644
index bf9639bf6271..000000000000
--- a/erpnext/education/doctype/student_batch_name/test_student_batch_name.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-# test_records = frappe.get_test_records('Student Batch Name')
-
-
-class TestStudentBatchName(unittest.TestCase):
- pass
diff --git a/erpnext/education/doctype/student_category/__init__.py b/erpnext/education/doctype/student_category/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_category/student_category.js b/erpnext/education/doctype/student_category/student_category.js
deleted file mode 100644
index 3a264d1d4a1a..000000000000
--- a/erpnext/education/doctype/student_category/student_category.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Student Category', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/education/doctype/student_category/student_category.json b/erpnext/education/doctype/student_category/student_category.json
deleted file mode 100644
index d7d4444a281a..000000000000
--- a/erpnext/education/doctype/student_category/student_category.json
+++ /dev/null
@@ -1,93 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "field:category",
- "beta": 0,
- "creation": "2016-09-05 06:28:33.679415",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "category",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Category",
- "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
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2017-11-10 19:09:45.783401",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Category",
- "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,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 0,
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_category/student_category.py b/erpnext/education/doctype/student_category/student_category.py
deleted file mode 100644
index 0d7185967ed9..000000000000
--- a/erpnext/education/doctype/student_category/student_category.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentCategory(Document):
- pass
diff --git a/erpnext/education/doctype/student_category/student_category_dashboard.py b/erpnext/education/doctype/student_category/student_category_dashboard.py
deleted file mode 100644
index d7a332c4d2a8..000000000000
--- a/erpnext/education/doctype/student_category/student_category_dashboard.py
+++ /dev/null
@@ -1,8 +0,0 @@
-from frappe import _
-
-
-def get_data():
- return {
- "fieldname": "student_category",
- "transactions": [{"label": _("Fee"), "items": ["Fee Structure", "Fee Schedule", "Fees"]}],
- }
diff --git a/erpnext/education/doctype/student_category/test_student_category.py b/erpnext/education/doctype/student_category/test_student_category.py
deleted file mode 100644
index 5671e9fa4477..000000000000
--- a/erpnext/education/doctype/student_category/test_student_category.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-# test_records = frappe.get_test_records('Student Category')
-
-
-class TestStudentCategory(unittest.TestCase):
- pass
diff --git a/erpnext/education/doctype/student_group/__init__.py b/erpnext/education/doctype/student_group/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_group/student_group.js b/erpnext/education/doctype/student_group/student_group.js
deleted file mode 100644
index 39ee9cebd101..000000000000
--- a/erpnext/education/doctype/student_group/student_group.js
+++ /dev/null
@@ -1,145 +0,0 @@
-cur_frm.add_fetch('student', 'title', 'student_name');
-
-frappe.ui.form.on('Student Group', {
- onload: function(frm) {
- frm.set_query('academic_term', function() {
- return {
- filters: {
- 'academic_year': (frm.doc.academic_year)
- }
- };
- });
- if (!frm.__islocal) {
- frm.set_query('student', 'students', function() {
- return{
- query: 'erpnext.education.doctype.student_group.student_group.fetch_students',
- filters: {
- 'academic_year': frm.doc.academic_year,
- 'group_based_on': frm.doc.group_based_on,
- 'academic_term': frm.doc.academic_term,
- 'program': frm.doc.program,
- 'batch': frm.doc.batch,
- 'student_category': frm.doc.student_category,
- 'course': frm.doc.course,
- 'student_group': frm.doc.name
- }
- }
- });
- }
- },
-
- refresh: function(frm) {
- if (!frm.doc.__islocal) {
-
- frm.add_custom_button(__('Add Guardians to Email Group'), function() {
- frappe.call({
- method: 'erpnext.education.api.update_email_group',
- args: {
- 'doctype': 'Student Group',
- 'name': frm.doc.name
- }
- });
- }, __('Actions'));
-
- frm.add_custom_button(__('Student Attendance Tool'), function() {
- frappe.route_options = {
- based_on: 'Student Group',
- student_group: frm.doc.name
- }
- frappe.set_route('Form', 'Student Attendance Tool', 'Student Attendance Tool');
- }, __('Tools'));
-
- frm.add_custom_button(__('Course Scheduling Tool'), function() {
- frappe.route_options = {
- student_group: frm.doc.name
- }
- frappe.set_route('Form', 'Course Scheduling Tool', 'Course Scheduling Tool');
- }, __('Tools'));
-
- frm.add_custom_button(__('Newsletter'), function() {
- frappe.route_options = {
- 'Newsletter Email Group.email_group': frm.doc.name
- }
- frappe.set_route('List', 'Newsletter');
- }, __('View'));
-
- }
- },
-
- group_based_on: function(frm) {
- if (frm.doc.group_based_on == 'Batch') {
- frm.doc.course = null;
- frm.set_df_property('program', 'reqd', 1);
- frm.set_df_property('course', 'reqd', 0);
- }
- else if (frm.doc.group_based_on == 'Course') {
- frm.set_df_property('program', 'reqd', 0);
- frm.set_df_property('course', 'reqd', 1);
- }
- else if (frm.doc.group_based_on == 'Activity') {
- frm.set_df_property('program', 'reqd', 0);
- frm.set_df_property('course', 'reqd', 0);
- }
- },
-
- get_students: function(frm) {
- if (frm.doc.group_based_on == 'Batch' || frm.doc.group_based_on == 'Course') {
- var student_list = [];
- var max_roll_no = 0;
- $.each(frm.doc.students, function(_i,d) {
- student_list.push(d.student);
- if (d.group_roll_number>max_roll_no) {
- max_roll_no = d.group_roll_number;
- }
- });
-
- if (frm.doc.academic_year) {
- frappe.call({
- method: 'erpnext.education.doctype.student_group.student_group.get_students',
- args: {
- 'academic_year': frm.doc.academic_year,
- 'academic_term': frm.doc.academic_term,
- 'group_based_on': frm.doc.group_based_on,
- 'program': frm.doc.program,
- 'batch' : frm.doc.batch,
- 'student_category' : frm.doc.student_category,
- 'course': frm.doc.course
- },
- callback: function(r) {
- if (r.message) {
- $.each(r.message, function(i, d) {
- if(!in_list(student_list, d.student)) {
- var s = frm.add_child('students');
- s.student = d.student;
- s.student_name = d.student_name;
- if (d.active === 0) {
- s.active = 0;
- }
- s.group_roll_number = ++max_roll_no;
- }
- });
- refresh_field('students');
- frm.save();
- } else {
- frappe.msgprint(__('Student Group is already updated.'))
- }
- }
- })
- }
- } else {
- frappe.msgprint(__('Select students manually for the Activity based Group'));
- }
- }
-});
-
-frappe.ui.form.on('Student Group Instructor', {
- instructors_add: function(frm){
- frm.fields_dict['instructors'].grid.get_field('instructor').get_query = function(doc){
- let instructor_list = [];
- $.each(doc.instructors, function(idx, val){
- instructor_list.push(val.instructor);
- });
- return { filters: [['Instructor', 'name', 'not in', instructor_list]] };
- };
- }
-});
diff --git a/erpnext/education/doctype/student_group/student_group.json b/erpnext/education/doctype/student_group/student_group.json
deleted file mode 100644
index 44b38b134500..000000000000
--- a/erpnext/education/doctype/student_group/student_group.json
+++ /dev/null
@@ -1,161 +0,0 @@
-{
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:student_group_name",
- "creation": "2015-09-07 12:55:52.072792",
- "doctype": "DocType",
- "document_type": "Document",
- "engine": "InnoDB",
- "field_order": [
- "academic_year",
- "group_based_on",
- "student_group_name",
- "max_strength",
- "column_break_3",
- "academic_term",
- "program",
- "batch",
- "student_category",
- "course",
- "disabled",
- "section_break_6",
- "get_students",
- "students",
- "section_break_12",
- "instructors"
- ],
- "fields": [
- {
- "fieldname": "academic_year",
- "fieldtype": "Link",
- "in_standard_filter": 1,
- "label": "Academic Year",
- "options": "Academic Year",
- "set_only_once": 1
- },
- {
- "fieldname": "group_based_on",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Group Based on",
- "options": "\nBatch\nCourse\nActivity",
- "reqd": 1
- },
- {
- "fieldname": "student_group_name",
- "fieldtype": "Data",
- "label": "Student Group Name",
- "reqd": 1,
- "unique": 1
- },
- {
- "description": "Set 0 for no limit",
- "fieldname": "max_strength",
- "fieldtype": "Int",
- "label": "Max Strength"
- },
- {
- "fieldname": "column_break_3",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "academic_term",
- "fieldtype": "Link",
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "Academic Term",
- "options": "Academic Term"
- },
- {
- "fieldname": "program",
- "fieldtype": "Link",
- "in_global_search": 1,
- "label": "Program",
- "options": "Program"
- },
- {
- "fieldname": "batch",
- "fieldtype": "Link",
- "in_global_search": 1,
- "label": "Batch",
- "options": "Student Batch Name"
- },
- {
- "depends_on": "eval:doc.group_based_on == 'Course'",
- "fieldname": "course",
- "fieldtype": "Link",
- "in_global_search": 1,
- "in_standard_filter": 1,
- "label": "Course",
- "options": "Course"
- },
- {
- "default": "0",
- "fieldname": "disabled",
- "fieldtype": "Check",
- "label": "Disabled"
- },
- {
- "depends_on": "eval:!doc.__islocal",
- "fieldname": "section_break_6",
- "fieldtype": "Section Break",
- "label": "Students"
- },
- {
- "fieldname": "get_students",
- "fieldtype": "Button",
- "label": "Get Students"
- },
- {
- "allow_on_submit": 1,
- "fieldname": "students",
- "fieldtype": "Table",
- "label": "Students",
- "options": "Student Group Student"
- },
- {
- "fieldname": "section_break_12",
- "fieldtype": "Section Break",
- "label": "Instructors"
- },
- {
- "fieldname": "instructors",
- "fieldtype": "Table",
- "label": "Instructors",
- "options": "Student Group Instructor"
- },
- {
- "fieldname": "student_category",
- "fieldtype": "Link",
- "label": "Student Category",
- "options": "Student Category"
- }
- ],
- "modified": "2019-04-26 10:52:57.303951",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Group",
- "owner": "Administrator",
- "permissions": [
- {
- "read": 1,
- "role": "Instructor"
- },
- {
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Academics User",
- "share": 1,
- "write": 1
- }
- ],
- "restrict_to_domain": "Education",
- "search_fields": "program, batch, course",
- "sort_field": "modified",
- "sort_order": "DESC"
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_group/student_group.py b/erpnext/education/doctype/student_group/student_group.py
deleted file mode 100644
index a94489ba53bb..000000000000
--- a/erpnext/education/doctype/student_group/student_group.py
+++ /dev/null
@@ -1,200 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies and contributors
-# For license information, please see license.txt
-
-
-import frappe
-from frappe import _
-from frappe.model.document import Document
-from frappe.utils import cint
-
-from erpnext.education.utils import validate_duplicate_student
-
-
-class StudentGroup(Document):
- def validate(self):
- self.validate_mandatory_fields()
- self.validate_strength()
- self.validate_students()
- self.validate_and_set_child_table_fields()
- validate_duplicate_student(self.students)
-
- def validate_mandatory_fields(self):
- if self.group_based_on == "Course" and not self.course:
- frappe.throw(_("Please select Course"))
- if self.group_based_on == "Course" and (not self.program and self.batch):
- frappe.throw(_("Please select Program"))
- if self.group_based_on == "Batch" and not self.program:
- frappe.throw(_("Please select Program"))
-
- def validate_strength(self):
- if cint(self.max_strength) < 0:
- frappe.throw(_("""Max strength cannot be less than zero."""))
- 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)
- )
-
- def validate_students(self):
- program_enrollment = get_program_enrollment(
- self.academic_year,
- self.academic_term,
- self.program,
- self.batch,
- self.student_category,
- self.course,
- )
- students = [d.student for d in program_enrollment] if program_enrollment else []
- for d in self.students:
- if not frappe.db.get_value("Student", d.student, "enabled") and d.active and not self.disabled:
- frappe.throw(_("{0} - {1} is inactive student").format(d.group_roll_number, d.student_name))
-
- if (
- (self.group_based_on == "Batch")
- and cint(frappe.defaults.get_defaults().validate_batch)
- and d.student not in students
- ):
- frappe.throw(
- _("{0} - {1} is not enrolled in the Batch {2}").format(
- d.group_roll_number, d.student_name, self.batch
- )
- )
-
- if (
- (self.group_based_on == "Course")
- and cint(frappe.defaults.get_defaults().validate_course)
- and (d.student not in students)
- ):
- frappe.throw(
- _("{0} - {1} is not enrolled in the Course {2}").format(
- d.group_roll_number, d.student_name, self.course
- )
- )
-
- def validate_and_set_child_table_fields(self):
- roll_numbers = [d.group_roll_number for d in self.students if d.group_roll_number]
- max_roll_no = max(roll_numbers) if roll_numbers else 0
- roll_no_list = []
- for d in self.students:
- if not d.student_name:
- d.student_name = frappe.db.get_value("Student", d.student, "title")
- if not d.group_roll_number:
- max_roll_no += 1
- d.group_roll_number = max_roll_no
- if d.group_roll_number in roll_no_list:
- frappe.throw(_("Duplicate roll number for student {0}").format(d.student_name))
- else:
- roll_no_list.append(d.group_roll_number)
-
-
-@frappe.whitelist()
-def get_students(
- academic_year,
- group_based_on,
- academic_term=None,
- program=None,
- batch=None,
- student_category=None,
- course=None,
-):
- enrolled_students = get_program_enrollment(
- academic_year, academic_term, program, batch, student_category, course
- )
-
- if enrolled_students:
- student_list = []
- for s in enrolled_students:
- if frappe.db.get_value("Student", s.student, "enabled"):
- s.update({"active": 1})
- else:
- s.update({"active": 0})
- student_list.append(s)
- return student_list
- else:
- frappe.msgprint(_("No students found"))
- return []
-
-
-def get_program_enrollment(
- academic_year, academic_term=None, program=None, batch=None, student_category=None, course=None
-):
-
- condition1 = " "
- condition2 = " "
- if academic_term:
- condition1 += " and pe.academic_term = %(academic_term)s"
- if program:
- condition1 += " and pe.program = %(program)s"
- if batch:
- condition1 += " and pe.student_batch_name = %(batch)s"
- if student_category:
- condition1 += " and pe.student_category = %(student_category)s"
- if course:
- condition1 += " and pe.name = pec.parent and pec.course = %(course)s"
- condition2 = ", `tabProgram Enrollment Course` pec"
-
- return frappe.db.sql(
- """
- select
- pe.student, pe.student_name
- from
- `tabProgram Enrollment` pe {condition2}
- where
- pe.academic_year = %(academic_year)s {condition1}
- order by
- pe.student_name asc
- """.format(
- condition1=condition1, condition2=condition2
- ),
- (
- {
- "academic_year": academic_year,
- "academic_term": academic_term,
- "program": program,
- "batch": batch,
- "student_category": student_category,
- "course": course,
- }
- ),
- as_dict=1,
- )
-
-
-@frappe.whitelist()
-@frappe.validate_and_sanitize_search_inputs
-def fetch_students(doctype, txt, searchfield, start, page_len, filters):
- if filters.get("group_based_on") != "Activity":
- enrolled_students = get_program_enrollment(
- filters.get("academic_year"),
- filters.get("academic_term"),
- filters.get("program"),
- filters.get("batch"),
- filters.get("student_category"),
- )
- student_group_student = frappe.db.sql_list(
- """select student from `tabStudent Group Student` where parent=%s""",
- (filters.get("student_group")),
- )
- students = (
- [d.student for d in enrolled_students if d.student not in student_group_student]
- if enrolled_students
- else [""]
- ) or [""]
- return frappe.db.sql(
- """select name, title from tabStudent
- where name in ({0}) and (`{1}` LIKE %s or title LIKE %s)
- order by idx desc, name
- limit %s, %s""".format(
- ", ".join(["%s"] * len(students)), searchfield
- ),
- tuple(students + ["%%%s%%" % txt, "%%%s%%" % txt, start, page_len]),
- )
- else:
- return frappe.db.sql(
- """select name, title from tabStudent
- where `{0}` LIKE %s or title LIKE %s
- order by idx desc, name
- limit %s, %s""".format(
- searchfield
- ),
- tuple(["%%%s%%" % txt, "%%%s%%" % txt, start, page_len]),
- )
diff --git a/erpnext/education/doctype/student_group/student_group_dashboard.py b/erpnext/education/doctype/student_group/student_group_dashboard.py
deleted file mode 100644
index 094b5a023513..000000000000
--- a/erpnext/education/doctype/student_group/student_group_dashboard.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-from frappe import _
-
-
-def get_data():
- return {
- "fieldname": "student_group",
- "transactions": [
- {"label": _("Assessment"), "items": ["Assessment Plan", "Assessment Result"]},
- {"label": _("Course"), "items": ["Course Schedule"]},
- ],
- }
diff --git a/erpnext/education/doctype/student_group/test_records.json b/erpnext/education/doctype/student_group/test_records.json
deleted file mode 100644
index 4c4e042b1529..000000000000
--- a/erpnext/education/doctype/student_group/test_records.json
+++ /dev/null
@@ -1,34 +0,0 @@
-[
- {
- "student_group_name": "Batch-_TP1-_Batch 1-2014-2015 (_Test Academic Term)",
- "group_based_on": "Batch",
- "program": "_TP1",
- "batch": "_Batch 1",
- "academic_year": "2014-2015",
- "academic_term": "2014-2015 (_Test Academic Term)",
- "max_strength": 0
- },
- {
- "student_group_name": "Course-TC101-2014-2015 (_Test Academic Term)",
- "group_based_on": "Course",
- "course": "TC101",
- "academic_year": "2014-2015",
- "academic_term": "2014-2015 (_Test Academic Term)",
- "max_strength": 0
- },
- {
- "student_group_name": "Course-TC102-2014-2015 (_Test Academic Term)",
- "group_based_on": "Course",
- "course": "TC102",
- "academic_year": "2014-2015",
- "academic_term": "2014-2015 (_Test Academic Term)",
- "max_strength": 0
- },
- {
- "student_group_name": "Activity-2014-2015 (_Test Academic Term)",
- "group_based_on": "Activity",
- "academic_year": "2014-2015",
- "academic_term": "2014-2015 (_Test Academic Term)",
- "max_strength": 0
- }
-]
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_group/test_student_group.py b/erpnext/education/doctype/student_group/test_student_group.py
deleted file mode 100644
index 84b49309acb4..000000000000
--- a/erpnext/education/doctype/student_group/test_student_group.py
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies and Contributors
-# See license.txt
-
-import unittest
-
-import frappe
-
-import erpnext.education
-
-
-def get_random_group():
- doc = frappe.get_doc(
- {
- "doctype": "Student Group",
- "student_group_name": "_Test Student Group-" + frappe.generate_hash(length=5),
- "group_based_on": "Activity",
- }
- ).insert()
-
- student_list = frappe.get_all("Student", limit=5)
-
- doc.extend("students", [{"student": d.name, "active": 1} for d in student_list])
- doc.save()
-
- return doc
-
-
-class TestStudentGroup(unittest.TestCase):
- def test_student_roll_no(self):
- doc = get_random_group()
- self.assertEqual(max([d.group_roll_number for d in doc.students]), len(doc.students))
-
- def test_in_group(self):
- doc = get_random_group()
-
- last_student = doc.students[-1].student
-
- # remove last student
- doc.students = doc.students[:-1]
- doc.save()
-
- self.assertRaises(
- erpnext.education.StudentNotInGroupError,
- erpnext.education.validate_student_belongs_to_group,
- last_student,
- doc.name,
- )
-
- # safe, don't throw validation
- erpnext.education.validate_student_belongs_to_group(doc.students[0].student, doc.name)
diff --git a/erpnext/education/doctype/student_group_creation_tool/__init__.py b/erpnext/education/doctype/student_group_creation_tool/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.js b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.js
deleted file mode 100644
index c189e2763c81..000000000000
--- a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.js
+++ /dev/null
@@ -1,40 +0,0 @@
-frappe.ui.form.on("Student Group Creation Tool", "refresh", function(frm) {
- frm.disable_save();
- frm.page.set_primary_action(__("Create Student Groups"), function() {
- frappe.call({
- method: "create_student_groups",
- doc:frm.doc
- })
- });
- frappe.realtime.on("student_group_creation_progress", function(data) {
- if(data.progress) {
- frappe.hide_msgprint(true);
- frappe.show_progress(__("Creating student groups"), data.progress[0],data.progress[1]);
- }
- });
-});
-
-frappe.ui.form.on("Student Group Creation Tool", "get_courses", function(frm) {
- frm.set_value("courses",[]);
- if (frm.doc.academic_year && frm.doc.program) {
- frappe.call({
- method: "get_courses",
- doc:frm.doc,
- callback: function(r) {
- if(r.message) {
- frm.set_value("courses", r.message);
- }
- }
- })
- }
-});
-
-frappe.ui.form.on("Student Group Creation Tool", "onload", function(frm){
- cur_frm.set_query("academic_term",function(){
- return{
- "filters":{
- "academic_year": (frm.doc.academic_year)
- }
- };
- });
-});
diff --git a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json
deleted file mode 100644
index fe7cbdb0b8f7..000000000000
--- a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.json
+++ /dev/null
@@ -1,309 +0,0 @@
-{
- "allow_copy": 1,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2016-01-04 14:45:36.576933",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 0,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "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_global_search": 0,
- "in_list_view": 1,
- "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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Leave blank if you make students groups per year",
- "fieldname": "academic_term",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Academic Term",
- "length": 0,
- "no_copy": 0,
- "options": "Academic Term",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "get_courses",
- "fieldtype": "Button",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Get Courses",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_4",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "",
- "fieldname": "program",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "description": "Leave unchecked if you don't want to consider batch while making course based groups. ",
- "fieldname": "separate_groups",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Separate course based Group for every Batch",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_4",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "courses",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Courses",
- "length": 0,
- "no_copy": 0,
- "options": "Student Group Creation Tool Course",
- "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
- }
- ],
- "has_web_view": 0,
- "hide_heading": 1,
- "hide_toolbar": 1,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 1,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2017-12-27 09:35:30.211254",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Group Creation Tool",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "apply_user_permissions": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "Education Manager",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 1
- }
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py b/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py
deleted file mode 100644
index bbeb654bfc4d..000000000000
--- a/erpnext/education/doctype/student_group_creation_tool/student_group_creation_tool.py
+++ /dev/null
@@ -1,101 +0,0 @@
-# Copyright (c) 2015, Frappe and contributors
-# For license information, please see license.txt
-
-
-import frappe
-from frappe import _
-from frappe.model.document import Document
-
-from erpnext.education.doctype.student_group.student_group import get_students
-
-
-class StudentGroupCreationTool(Document):
- @frappe.whitelist()
- def get_courses(self):
- group_list = []
-
- batches = frappe.db.sql("""select name as batch from `tabStudent Batch Name`""", as_dict=1)
- for batch in batches:
- group_list.append({"group_based_on": "Batch", "batch": batch.batch})
-
- courses = frappe.db.sql(
- """select course, course_name from `tabProgram Course` where parent=%s""",
- (self.program),
- as_dict=1,
- )
- if self.separate_groups:
- from itertools import product
-
- course_list = product(courses, batches)
- for course in course_list:
- temp_dict = {}
- temp_dict.update({"group_based_on": "Course"})
- temp_dict.update(course[0])
- temp_dict.update(course[1])
- group_list.append(temp_dict)
- else:
- for course in courses:
- course.update({"group_based_on": "Course"})
- group_list.append(course)
-
- for group in group_list:
- if group.get("group_based_on") == "Batch":
- student_group_name = (
- self.program
- + "/"
- + group.get("batch")
- + "/"
- + (self.academic_term if self.academic_term else self.academic_year)
- )
- group.update({"student_group_name": student_group_name})
- elif group.get("group_based_on") == "Course":
- student_group_name = (
- group.get("course")
- + "/"
- + self.program
- + ("/" + group.get("batch") if group.get("batch") else "")
- + "/"
- + (self.academic_term if self.academic_term else self.academic_year)
- )
- group.update({"student_group_name": student_group_name})
-
- return group_list
-
- @frappe.whitelist()
- def create_student_groups(self):
- if not self.courses:
- frappe.throw(_("""No Student Groups created."""))
-
- l = len(self.courses)
- for d in self.courses:
- if not d.student_group_name:
- frappe.throw(_("Student Group Name is mandatory in row {0}").format(d.idx))
-
- if d.group_based_on == "Course" and not d.course:
- frappe.throw(_("Course is mandatory in row {0}").format(d.idx))
-
- if d.group_based_on == "Batch" and not d.batch:
- frappe.throw(_("Batch is mandatory in row {0}").format(d.idx))
-
- frappe.publish_realtime(
- "student_group_creation_progress", {"progress": [d.idx, l]}, user=frappe.session.user
- )
-
- student_group = frappe.new_doc("Student Group")
- student_group.student_group_name = d.student_group_name
- student_group.group_based_on = d.group_based_on
- student_group.program = self.program
- student_group.course = d.course
- student_group.batch = d.batch
- student_group.max_strength = d.max_strength
- student_group.academic_term = self.academic_term
- student_group.academic_year = self.academic_year
- student_list = get_students(
- self.academic_year, d.group_based_on, self.academic_term, self.program, d.batch, d.course
- )
-
- for student in student_list:
- student_group.append("students", student)
- student_group.save()
-
- frappe.msgprint(_("{0} Student Groups created.").format(l))
diff --git a/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py b/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py
deleted file mode 100644
index 8722f973a844..000000000000
--- a/erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-
-class TestStudentGroupCreationTool(unittest.TestCase):
- pass
diff --git a/erpnext/education/doctype/student_group_creation_tool_course/__init__.py b/erpnext/education/doctype/student_group_creation_tool_course/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json b/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
deleted file mode 100644
index 9f691a1cb0aa..000000000000
--- a/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.json
+++ /dev/null
@@ -1,272 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2016-01-04 15:03:57.940079",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "group_based_on",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Group Based On",
- "length": 0,
- "no_copy": 0,
- "options": "\nBatch\nCourse",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "course",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Course",
- "length": 0,
- "no_copy": 0,
- "options": "Course",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "batch",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Batch",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "student_group_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Student Group 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "course.course_name",
- "fieldname": "course_code",
- "fieldtype": "Read Only",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Course Code",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "permlevel": 0,
- "precision": "",
- "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,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "max_strength",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Max Strength",
- "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,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2018-11-04 03:38:52.525155",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Group Creation Tool Course",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py b/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py
deleted file mode 100644
index 78e45411fd22..000000000000
--- a/erpnext/education/doctype/student_group_creation_tool_course/student_group_creation_tool_course.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentGroupCreationToolCourse(Document):
- pass
diff --git a/erpnext/education/doctype/student_group_instructor/__init__.py b/erpnext/education/doctype/student_group_instructor/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_group_instructor/student_group_instructor.json b/erpnext/education/doctype/student_group_instructor/student_group_instructor.json
deleted file mode 100644
index cb4e52756bb8..000000000000
--- a/erpnext/education/doctype/student_group_instructor/student_group_instructor.json
+++ /dev/null
@@ -1,142 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2017-04-17 16:06:01.406768",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "instructor",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Instructor",
- "length": 0,
- "no_copy": 0,
- "options": "Instructor",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "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_global_search": 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "instructor.instructor_name",
- "fieldname": "instructor_name",
- "fieldtype": "Read Only",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Instructor Name",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2018-11-04 03:39:02.413082",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Group Instructor",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 0,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_group_instructor/student_group_instructor.py b/erpnext/education/doctype/student_group_instructor/student_group_instructor.py
deleted file mode 100644
index 05ef6fc11644..000000000000
--- a/erpnext/education/doctype/student_group_instructor/student_group_instructor.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentGroupInstructor(Document):
- pass
diff --git a/erpnext/education/doctype/student_group_student/__init__.py b/erpnext/education/doctype/student_group_student/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_group_student/student_group_student.json b/erpnext/education/doctype/student_group_student/student_group_student.json
deleted file mode 100644
index d55db344eb0e..000000000000
--- a/erpnext/education/doctype/student_group_student/student_group_student.json
+++ /dev/null
@@ -1,204 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2015-09-11 15:14:58.501830",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "student",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Student",
- "length": 0,
- "no_copy": 0,
- "options": "Student",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "student_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Student Name",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "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,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "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_global_search": 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "group_roll_number",
- "fieldtype": "Int",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Group Roll Number",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "1",
- "fieldname": "active",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Active",
- "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,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2018-11-04 03:38:22.896203",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Group Student",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 0,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_group_student/student_group_student.py b/erpnext/education/doctype/student_group_student/student_group_student.py
deleted file mode 100644
index f9d00abde0b0..000000000000
--- a/erpnext/education/doctype/student_group_student/student_group_student.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentGroupStudent(Document):
- pass
diff --git a/erpnext/education/doctype/student_guardian/__init__.py b/erpnext/education/doctype/student_guardian/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_guardian/student_guardian.json b/erpnext/education/doctype/student_guardian/student_guardian.json
deleted file mode 100644
index 3f03a3d1a2ec..000000000000
--- a/erpnext/education/doctype/student_guardian/student_guardian.json
+++ /dev/null
@@ -1,141 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2016-09-01 14:28:39.174471",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "guardian",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Guardian",
- "length": 0,
- "no_copy": 0,
- "options": "Guardian",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "guardian_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 1,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Guardian Name",
- "length": 0,
- "no_copy": 0,
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "relation",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Relation",
- "length": 0,
- "no_copy": 0,
- "options": "\nMother\nFather\nOthers",
- "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,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2018-11-04 03:38:14.211238",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Guardian",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 0,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_guardian/student_guardian.py b/erpnext/education/doctype/student_guardian/student_guardian.py
deleted file mode 100644
index 0843acfd50a0..000000000000
--- a/erpnext/education/doctype/student_guardian/student_guardian.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentGuardian(Document):
- pass
diff --git a/erpnext/education/doctype/student_language/__init__.py b/erpnext/education/doctype/student_language/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_language/student_language.js b/erpnext/education/doctype/student_language/student_language.js
deleted file mode 100644
index 6239ed1e4496..000000000000
--- a/erpnext/education/doctype/student_language/student_language.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Student Language', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/education/doctype/student_language/student_language.json b/erpnext/education/doctype/student_language/student_language.json
deleted file mode 100644
index fc53cd13c66a..000000000000
--- a/erpnext/education/doctype/student_language/student_language.json
+++ /dev/null
@@ -1,98 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "field:language_name",
- "beta": 0,
- "creation": "2017-02-21 01:55:00.366273",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "language_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Language 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,
- "translatable": 0,
- "unique": 1
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-11-04 03:37:34.712397",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Language",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 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,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_language/student_language.py b/erpnext/education/doctype/student_language/student_language.py
deleted file mode 100644
index d578c9a0b66c..000000000000
--- a/erpnext/education/doctype/student_language/student_language.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentLanguage(Document):
- pass
diff --git a/erpnext/education/doctype/student_language/test_student_language.py b/erpnext/education/doctype/student_language/test_student_language.py
deleted file mode 100644
index d1a8b6d52668..000000000000
--- a/erpnext/education/doctype/student_language/test_student_language.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-# test_records = frappe.get_test_records('Student Language')
-
-
-class TestStudentLanguage(unittest.TestCase):
- pass
diff --git a/erpnext/education/doctype/student_leave_application/__init__.py b/erpnext/education/doctype/student_leave_application/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_leave_application/student_leave_application.js b/erpnext/education/doctype/student_leave_application/student_leave_application.js
deleted file mode 100644
index 4746148311da..000000000000
--- a/erpnext/education/doctype/student_leave_application/student_leave_application.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Student Leave Application', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/education/doctype/student_leave_application/student_leave_application.json b/erpnext/education/doctype/student_leave_application/student_leave_application.json
deleted file mode 100644
index 31b3da2fbd4e..000000000000
--- a/erpnext/education/doctype/student_leave_application/student_leave_application.json
+++ /dev/null
@@ -1,165 +0,0 @@
-{
- "actions": [],
- "autoname": "EDU-SLA-.YYYY.-.#####",
- "creation": "2016-11-28 15:38:54.793854",
- "doctype": "DocType",
- "editable_grid": 1,
- "engine": "InnoDB",
- "field_order": [
- "student",
- "student_name",
- "column_break_3",
- "from_date",
- "to_date",
- "total_leave_days",
- "section_break_5",
- "attendance_based_on",
- "student_group",
- "course_schedule",
- "mark_as_present",
- "column_break_11",
- "reason",
- "amended_from"
- ],
- "fields": [
- {
- "fieldname": "student",
- "fieldtype": "Link",
- "in_global_search": 1,
- "label": "Student",
- "options": "Student",
- "reqd": 1
- },
- {
- "fetch_from": "student.title",
- "fieldname": "student_name",
- "fieldtype": "Read Only",
- "in_global_search": 1,
- "label": "Student Name",
- "read_only": 1
- },
- {
- "fieldname": "column_break_3",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "from_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "From Date",
- "reqd": 1
- },
- {
- "fieldname": "to_date",
- "fieldtype": "Date",
- "in_list_view": 1,
- "label": "To Date",
- "reqd": 1
- },
- {
- "default": "0",
- "description": "Check this to mark the student as present in case the student is not attending the institute to participate or represent the institute in any event.\n\n",
- "fieldname": "mark_as_present",
- "fieldtype": "Check",
- "label": "Mark as Present"
- },
- {
- "fieldname": "section_break_5",
- "fieldtype": "Section Break"
- },
- {
- "fieldname": "reason",
- "fieldtype": "Text",
- "label": "Reason"
- },
- {
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "label": "Amended From",
- "no_copy": 1,
- "options": "Student Leave Application",
- "print_hide": 1,
- "read_only": 1
- },
- {
- "allow_in_quick_entry": 1,
- "default": "Student Group",
- "fieldname": "attendance_based_on",
- "fieldtype": "Select",
- "label": "Attendance Based On",
- "options": "Student Group\nCourse Schedule"
- },
- {
- "allow_in_quick_entry": 1,
- "depends_on": "eval:doc.attendance_based_on === \"Student Group\";",
- "fieldname": "student_group",
- "fieldtype": "Link",
- "label": "Student Group",
- "mandatory_depends_on": "eval:doc.attendance_based_on === \"Student Group\";",
- "options": "Student Group"
- },
- {
- "allow_in_quick_entry": 1,
- "depends_on": "eval:doc.attendance_based_on === \"Course Schedule\";",
- "fieldname": "course_schedule",
- "fieldtype": "Link",
- "label": "Course Schedule",
- "mandatory_depends_on": "eval:doc.attendance_based_on === \"Course Schedule\";",
- "options": "Course Schedule"
- },
- {
- "fieldname": "column_break_11",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "total_leave_days",
- "fieldtype": "Float",
- "label": "Total Leave Days",
- "read_only": 1
- }
- ],
- "is_submittable": 1,
- "links": [],
- "modified": "2020-09-21 18:10:24.440669",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Leave Application",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Instructor",
- "submit": 1,
- "write": 1
- },
- {
- "amend": 1,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Academics User",
- "share": 1,
- "submit": 1,
- "write": 1
- }
- ],
- "quick_entry": 1,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 1,
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "student_name"
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_leave_application/student_leave_application.py b/erpnext/education/doctype/student_leave_application/student_leave_application.py
deleted file mode 100644
index c3645cf48524..000000000000
--- a/erpnext/education/doctype/student_leave_application/student_leave_application.py
+++ /dev/null
@@ -1,135 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from datetime import timedelta
-
-import frappe
-from frappe import _
-from frappe.model.document import Document
-from frappe.utils import date_diff, flt, get_link_to_form, getdate
-
-from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list
-from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday
-
-
-class StudentLeaveApplication(Document):
- def validate(self):
- self.validate_holiday_list()
- self.validate_duplicate()
- self.validate_from_to_dates("from_date", "to_date")
-
- def on_submit(self):
- self.update_attendance()
-
- def on_cancel(self):
- self.cancel_attendance()
-
- def validate_duplicate(self):
- data = frappe.db.sql(
- """select name from `tabStudent Leave Application`
- where
- ((%(from_date)s > from_date and %(from_date)s < to_date) or
- (%(to_date)s > from_date and %(to_date)s < to_date) or
- (%(from_date)s <= from_date and %(to_date)s >= to_date)) and
- name != %(name)s and student = %(student)s and docstatus < 2
- """,
- {
- "from_date": self.from_date,
- "to_date": self.to_date,
- "student": self.student,
- "name": self.name,
- },
- as_dict=1,
- )
-
- if data:
- link = get_link_to_form("Student Leave Application", data[0].name)
- frappe.throw(
- _("Leave application {0} already exists against the student {1}").format(
- link, frappe.bold(self.student)
- ),
- title=_("Duplicate Entry"),
- )
-
- def validate_holiday_list(self):
- holiday_list = get_holiday_list()
- self.total_leave_days = get_number_of_leave_days(self.from_date, self.to_date, holiday_list)
-
- def update_attendance(self):
- holiday_list = get_holiday_list()
-
- for dt in daterange(getdate(self.from_date), getdate(self.to_date)):
- date = dt.strftime("%Y-%m-%d")
-
- if is_holiday(holiday_list, date):
- continue
-
- attendance = frappe.db.exists(
- "Student Attendance", {"student": self.student, "date": date, "docstatus": ("!=", 2)}
- )
-
- status = "Present" if self.mark_as_present else "Absent"
- if attendance:
- # update existing attendance record
- values = dict()
- values["status"] = status
- values["leave_application"] = self.name
- frappe.db.set_value("Student Attendance", attendance, values)
- else:
- # make a new attendance record
- doc = frappe.new_doc("Student Attendance")
- doc.student = self.student
- doc.student_name = self.student_name
- doc.date = date
- doc.leave_application = self.name
- doc.status = status
- if self.attendance_based_on == "Student Group":
- doc.student_group = self.student_group
- else:
- doc.course_schedule = self.course_schedule
- doc.insert(ignore_permissions=True, ignore_mandatory=True)
- doc.submit()
-
- def cancel_attendance(self):
- if self.docstatus == 2:
- attendance = frappe.db.sql(
- """
- SELECT name
- FROM `tabStudent Attendance`
- WHERE
- student = %s and
- (date between %s and %s) and
- docstatus < 2
- """,
- (self.student, self.from_date, self.to_date),
- as_dict=1,
- )
-
- for name in attendance:
- frappe.db.set_value("Student Attendance", name, "docstatus", 2)
-
-
-def daterange(start_date, end_date):
- for n in range(int((end_date - start_date).days) + 1):
- yield start_date + timedelta(n)
-
-
-def get_number_of_leave_days(from_date, to_date, holiday_list):
- number_of_days = date_diff(to_date, from_date) + 1
-
- holidays = frappe.db.sql(
- """
- SELECT
- COUNT(DISTINCT holiday_date)
- FROM `tabHoliday` h1,`tabHoliday List` h2
- WHERE
- h1.parent = h2.name and
- h1.holiday_date between %s and %s and
- h2.name = %s""",
- (from_date, to_date, holiday_list),
- )[0][0]
-
- number_of_days = flt(number_of_days) - flt(holidays)
-
- return number_of_days
diff --git a/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py b/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py
deleted file mode 100644
index 8819c3bf657f..000000000000
--- a/erpnext/education/doctype/student_leave_application/student_leave_application_dashboard.py
+++ /dev/null
@@ -1,2 +0,0 @@
-def get_data():
- return {"fieldname": "leave_application", "transactions": [{"items": ["Student Attendance"]}]}
diff --git a/erpnext/education/doctype/student_leave_application/test_student_leave_application.py b/erpnext/education/doctype/student_leave_application/test_student_leave_application.py
deleted file mode 100644
index 7146fc25768a..000000000000
--- a/erpnext/education/doctype/student_leave_application/test_student_leave_application.py
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-import frappe
-from frappe.utils import add_days, add_months, getdate
-
-from erpnext import get_default_company
-from erpnext.education.doctype.student.test_student import create_student
-from erpnext.education.doctype.student_group.test_student_group import get_random_group
-
-
-class TestStudentLeaveApplication(unittest.TestCase):
- def setUp(self):
- frappe.db.sql("""delete from `tabStudent Leave Application`""")
- create_holiday_list()
-
- def test_attendance_record_creation(self):
- leave_application = create_leave_application()
- attendance_record = frappe.db.exists(
- "Student Attendance", {"leave_application": leave_application.name, "status": "Absent"}
- )
- self.assertTrue(attendance_record)
-
- # mark as present
- date = add_days(getdate(), -1)
- leave_application = create_leave_application(date, date, 1)
- attendance_record = frappe.db.exists(
- "Student Attendance", {"leave_application": leave_application.name, "status": "Present"}
- )
- self.assertTrue(attendance_record)
-
- def test_attendance_record_updated(self):
- attendance = create_student_attendance()
- create_leave_application()
- self.assertEqual(frappe.db.get_value("Student Attendance", attendance.name, "status"), "Absent")
-
- def test_attendance_record_cancellation(self):
- leave_application = create_leave_application()
- leave_application.cancel()
- attendance_status = frappe.db.get_value(
- "Student Attendance", {"leave_application": leave_application.name}, "docstatus"
- )
- self.assertTrue(attendance_status, 2)
-
- def test_holiday(self):
- today = getdate()
- leave_application = create_leave_application(
- from_date=today, to_date=add_days(today, 1), submit=0
- )
-
- # holiday list validation
- company = get_default_company() or frappe.get_all("Company")[0].name
- frappe.db.set_value("Company", company, "default_holiday_list", "")
- self.assertRaises(frappe.ValidationError, leave_application.save)
-
- frappe.db.set_value("Company", company, "default_holiday_list", "Test Holiday List for Student")
- leave_application.save()
-
- leave_application.reload()
- self.assertEqual(leave_application.total_leave_days, 1)
-
- # check no attendance record created for a holiday
- leave_application.submit()
- self.assertIsNone(
- frappe.db.exists(
- "Student Attendance", {"leave_application": leave_application.name, "date": add_days(today, 1)}
- )
- )
-
- def tearDown(self):
- company = get_default_company() or frappe.get_all("Company")[0].name
- frappe.db.set_value("Company", company, "default_holiday_list", "_Test Holiday List")
-
-
-def create_leave_application(from_date=None, to_date=None, mark_as_present=0, submit=1):
- student = get_student()
-
- leave_application = frappe.new_doc("Student Leave Application")
- leave_application.student = student.name
- leave_application.attendance_based_on = "Student Group"
- leave_application.student_group = get_random_group().name
- leave_application.from_date = from_date if from_date else getdate()
- leave_application.to_date = from_date if from_date else getdate()
- leave_application.mark_as_present = mark_as_present
-
- if submit:
- leave_application.insert()
- leave_application.submit()
-
- return leave_application
-
-
-def create_student_attendance(date=None, status=None):
- student = get_student()
- attendance = frappe.get_doc(
- {
- "doctype": "Student Attendance",
- "student": student.name,
- "status": status if status else "Present",
- "date": date if date else getdate(),
- "student_group": get_random_group().name,
- }
- ).insert()
- return attendance
-
-
-def get_student():
- return create_student(
- dict(email="test_student@gmail.com", first_name="Test", last_name="Student")
- )
-
-
-def create_holiday_list():
- holiday_list = "Test Holiday List for Student"
- today = getdate()
- if not frappe.db.exists("Holiday List", holiday_list):
- frappe.get_doc(
- dict(
- doctype="Holiday List",
- holiday_list_name=holiday_list,
- from_date=add_months(today, -6),
- to_date=add_months(today, 6),
- holidays=[dict(holiday_date=add_days(today, 1), description="Test")],
- )
- ).insert()
-
- company = get_default_company() or frappe.get_all("Company")[0].name
- frappe.db.set_value("Company", company, "default_holiday_list", holiday_list)
- return holiday_list
diff --git a/erpnext/education/doctype/student_log/__init__.py b/erpnext/education/doctype/student_log/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_log/student_log.js b/erpnext/education/doctype/student_log/student_log.js
deleted file mode 100644
index 40e63e9f886a..000000000000
--- a/erpnext/education/doctype/student_log/student_log.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Student Log', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/education/doctype/student_log/student_log.json b/erpnext/education/doctype/student_log/student_log.json
deleted file mode 100644
index cdd6aaa82672..000000000000
--- a/erpnext/education/doctype/student_log/student_log.json
+++ /dev/null
@@ -1,423 +0,0 @@
-{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "autoname": "EDU-SLOG-.YYYY.-.#####",
- "beta": 0,
- "creation": "2016-07-29 03:27:22.451772",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "student",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 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,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fetch_from": "student.title",
- "fieldname": "student_name",
- "fieldtype": "Read Only",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 1,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Student Name",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "Type",
- "length": 0,
- "no_copy": 0,
- "options": "General\nAcademic\nMedical\nAchievement",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "date",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Date",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "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_global_search": 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "academic_term",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Academic Term",
- "length": 0,
- "no_copy": 0,
- "options": "Academic Term",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 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_global_search": 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "student_batch",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Student Batch",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_5",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "log",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 1,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Log",
- "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,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-08-21 16:15:47.027645",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Log",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 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": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "student_name",
- "track_changes": 0,
- "track_seen": 1,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_log/student_log.py b/erpnext/education/doctype/student_log/student_log.py
deleted file mode 100644
index b95f34e04933..000000000000
--- a/erpnext/education/doctype/student_log/student_log.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentLog(Document):
- pass
diff --git a/erpnext/education/doctype/student_log/test_student_log.py b/erpnext/education/doctype/student_log/test_student_log.py
deleted file mode 100644
index fef1ab56ac1d..000000000000
--- a/erpnext/education/doctype/student_log/test_student_log.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-# test_records = frappe.get_test_records('Student Log')
-
-
-class TestStudentLog(unittest.TestCase):
- pass
diff --git a/erpnext/education/doctype/student_report_generation_tool/__init__.py b/erpnext/education/doctype/student_report_generation_tool/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.html b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.html
deleted file mode 100644
index a9e84e6e277d..000000000000
--- a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.html
+++ /dev/null
@@ -1,371 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{ _("Student ID: ") }}
-
-
- {{ doc.students[0] }}
-
-
-
-
-
- {{ _("Student Name: ") }}
-
-
- {{ doc.student_name }}
-
-
-
-
-
- {{ _("Program: ") }}
-
-
- {{ doc.program }}
-
-
-
-
-
- {{ _("Batch: ") }}
-
-
- {{ doc.student_batch }}
-
-
-
-
-
-
-
- {{ _("Academic Year: ") }}
-
-
- {{ doc.academic_year }}
-
-
-
- {% if doc.academic_term %}
-
-
- {{ _("Academic Term: ") }}
-
-
- {{ doc.academic_term }}
-
-
- {% endif %}
-
-
-
- {{ _("Assessment Group: ") }}
-
-
- {{ doc.assessment_group }}
-
-
-
-
-
-
-{% if doc.show_marks | int %}
- {% set result_data = 'score' %}
-{% else %}
- {% set result_data = 'grade' %}
-{% endif %}
-
-
-{% for course in courses %}
-
-
-
-
-
-
-
-
-
- {{ _("Course: ") }}
-
-
- {{ course }} ({{ frappe.db.get_value("Course", course, "course_name") }})
-
-
-
-
-
- {{ _("Assessment Criteria") }}
- {% for assessment_group in assessment_groups %}
- {{ assessment_group }}
- {% endfor %}
-
-
-
-
- {% for criteria in course_criteria[course] %}
-
- {{ criteria }}
- {% for assessment_group in assessment_groups %}
- {% if (assessment_result.get(course) and assessment_result.get(course).get(assessment_group) and assessment_result.get(course).get(assessment_group).get(criteria)) %}
-
- {{ assessment_result.get(course).get(assessment_group).get(criteria).get(result_data) }}
- {% if result_data == 'score' %}
- ({{ assessment_result.get(course).get(assessment_group).get(criteria).get('maximum_score') }})
- {% endif %}
-
- {% else %}
-
- {% endif %}
- {% endfor %}
-
- {% endfor %}
-
-
-
-
-
-
-
-{% endfor %}
-
-
-
-
-
-
{{ _("Student Attendance")}}
-
- Present {{ doc.attendance.get("Present") if doc.attendance.get("Present") != None else '0' }} days
- out of {{ doc.attendance.get("Present") + doc.attendance.get("Absent") }}
-
-
-
-
-
{{ _("Parents Teacher Meeting Attendance")}}
-
- Present {{ doc.parents_attendance if doc.parents_attendance != None else '0' }}
- out of {{ doc.parents_meeting if doc.parents_meeting != None else '0' }}
-
-
-
-
-{% if doc.assessment_terms %}
-
-
-
{{ doc.assessment_terms }}
-
-
-{% endif %}
-
diff --git a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.js b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.js
deleted file mode 100644
index 565074d87848..000000000000
--- a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.js
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Student Report Generation Tool', {
- onload: function(frm) {
- frm.set_query("academic_term",function(){
- return{
- "filters":{
- "academic_year": frm.doc.academic_year
- }
- };
- });
- frm.set_query("assessment_group", function() {
- return{
- filters: {
- "is_group": 1
- }
- };
- });
- },
-
- refresh: function(frm) {
- frm.disable_save();
- frm.page.clear_indicator();
- frm.page.set_primary_action(__('Print Report Card'), () => {
- let url = "/api/method/erpnext.education.doctype.student_report_generation_tool.student_report_generation_tool.preview_report_card";
- open_url_post(url, {"doc": frm.doc}, true);
- });
- },
-
- student: function(frm) {
- if (frm.doc.student) {
- frappe.call({
- method:"erpnext.education.api.get_current_enrollment",
- args: {
- "student": frm.doc.student,
- "academic_year": frm.doc.academic_year
- },
- callback: function(r) {
- if(r){
- $.each(r.message, function(i, d) {
- if (frm.fields_dict.hasOwnProperty(i)) {
- frm.set_value(i, d);
- }
- });
- }
- }
- });
- }
- },
-
- terms: function(frm) {
- if(frm.doc.terms) {
- return frappe.call({
- method: 'erpnext.setup.doctype.terms_and_conditions.terms_and_conditions.get_terms_and_conditions',
- args: {
- template_name: frm.doc.terms,
- doc: frm.doc
- },
- callback: function(r) {
- frm.set_value("assessment_terms", r.message);
- }
- });
- }
- }
-});
diff --git a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.json b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.json
deleted file mode 100644
index a3282990d005..000000000000
--- a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.json
+++ /dev/null
@@ -1,618 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2018-01-15 15:36:32.830069",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "engine": "InnoDB",
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "student",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Student",
- "length": 0,
- "no_copy": 0,
- "options": "Student",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "student_name",
- "fieldtype": "Read Only",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Student 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": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 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_global_search": 0,
- "in_list_view": 1,
- "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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "student_batch",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Batch",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "include_all_assessment",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Include All Assessment Group",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "show_marks",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Show Marks",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "default": "1",
- "fieldname": "add_letterhead",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Add letterhead",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_3",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "assessment_group",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Assessment Group",
- "length": 0,
- "no_copy": 0,
- "options": "Assessment Group",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "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_global_search": 0,
- "in_list_view": 1,
- "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": 1,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "academic_term",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Academic Term",
- "length": 0,
- "no_copy": 0,
- "options": "Academic Term",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "add_letterhead",
- "fieldname": "letter_head",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Letter Head",
- "length": 0,
- "no_copy": 0,
- "options": "Letter Head",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_5",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Print Section",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "parents_meeting",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Total Parents Teacher Meeting",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "parents_attendance",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Attended by Parents",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "terms",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Terms",
- "length": 0,
- "no_copy": 0,
- "options": "Terms and Conditions",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "assessment_terms",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Assessment Terms",
- "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,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 1,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 1,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2018-11-04 03:38:42.970869",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Report Generation Tool",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [
- {
- "amend": 0,
- "cancel": 0,
- "create": 1,
- "delete": 0,
- "email": 0,
- "export": 0,
- "if_owner": 0,
- "import": 0,
- "permlevel": 0,
- "print": 0,
- "read": 1,
- "report": 0,
- "role": "System Manager",
- "set_user_permissions": 0,
- "share": 0,
- "submit": 0,
- "write": 1
- }
- ],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py b/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py
deleted file mode 100644
index ae3c140a2ef7..000000000000
--- a/erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.py
+++ /dev/null
@@ -1,121 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-import json
-
-import frappe
-from frappe import _
-from frappe.model.document import Document
-from frappe.utils.pdf import get_pdf
-
-from erpnext.education.report.course_wise_assessment_report.course_wise_assessment_report import (
- get_child_assessment_groups,
- get_formatted_result,
-)
-
-
-class StudentReportGenerationTool(Document):
- pass
-
-
-@frappe.whitelist()
-def preview_report_card(doc):
- doc = frappe._dict(json.loads(doc))
- doc.students = [doc.student]
- if not (doc.student_name and doc.student_batch):
- program_enrollment = frappe.get_all(
- "Program Enrollment",
- fields=["student_batch_name", "student_name"],
- filters={"student": doc.student, "docstatus": ("!=", 2), "academic_year": doc.academic_year},
- )
- if program_enrollment:
- doc.batch = program_enrollment[0].student_batch_name
- doc.student_name = program_enrollment[0].student_name
-
- # get the assessment result of the selected student
- values = get_formatted_result(
- doc, get_course=True, get_all_assessment_groups=doc.include_all_assessment
- )
- assessment_result = values.get("assessment_result").get(doc.student)
- courses = values.get("course_dict")
- course_criteria = get_courses_criteria(courses)
-
- # get the assessment group as per the user selection
- if doc.include_all_assessment:
- assessment_groups = get_child_assessment_groups(doc.assessment_group)
- else:
- assessment_groups = [doc.assessment_group]
-
- # get the attendance of the student for that peroid of time.
- doc.attendance = get_attendance_count(doc.students[0], doc.academic_year, doc.academic_term)
-
- template = (
- "erpnext/education/doctype/student_report_generation_tool/student_report_generation_tool.html"
- )
- base_template_path = "frappe/www/printview.html"
-
- from frappe.www.printview import get_letter_head
-
- letterhead = get_letter_head(
- frappe._dict({"letter_head": doc.letterhead}), not doc.add_letterhead
- )
-
- html = frappe.render_template(
- template,
- {
- "doc": doc,
- "assessment_result": assessment_result,
- "courses": courses,
- "assessment_groups": assessment_groups,
- "course_criteria": course_criteria,
- "letterhead": letterhead and letterhead.get("content", None),
- "add_letterhead": doc.add_letterhead if doc.add_letterhead else 0,
- },
- )
- final_template = frappe.render_template(
- base_template_path, {"body": html, "title": "Report Card"}
- )
-
- frappe.response.filename = "Report Card " + doc.students[0] + ".pdf"
- frappe.response.filecontent = get_pdf(final_template)
- frappe.response.type = "download"
-
-
-def get_courses_criteria(courses):
- course_criteria = frappe._dict()
- for course in courses:
- course_criteria[course] = [
- d.assessment_criteria
- for d in frappe.get_all(
- "Course Assessment Criteria", fields=["assessment_criteria"], filters={"parent": course}
- )
- ]
- return course_criteria
-
-
-def get_attendance_count(student, academic_year, academic_term=None):
- if academic_year:
- from_date, to_date = frappe.db.get_value(
- "Academic Year", academic_year, ["year_start_date", "year_end_date"]
- )
- elif academic_term:
- from_date, to_date = frappe.db.get_value(
- "Academic Term", academic_term, ["term_start_date", "term_end_date"]
- )
- if from_date and to_date:
- attendance = dict(
- frappe.db.sql(
- """select status, count(student) as no_of_days
- from `tabStudent Attendance` where student = %s and docstatus = 1
- and date between %s and %s group by status""",
- (student, from_date, to_date),
- )
- )
- if "Absent" not in attendance.keys():
- attendance["Absent"] = 0
- if "Present" not in attendance.keys():
- attendance["Present"] = 0
- return attendance
- else:
- frappe.throw(_("Provide the academic year and set the starting and ending date."))
diff --git a/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py b/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py
deleted file mode 100644
index e37881f01256..000000000000
--- a/erpnext/education/doctype/student_report_generation_tool/test_student_report_generation_tool.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-
-class TestStudentReportGenerationTool(unittest.TestCase):
- pass
diff --git a/erpnext/education/doctype/student_sibling/__init__.py b/erpnext/education/doctype/student_sibling/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_sibling/student_sibling.json b/erpnext/education/doctype/student_sibling/student_sibling.json
deleted file mode 100644
index f67fe79d98cc..000000000000
--- a/erpnext/education/doctype/student_sibling/student_sibling.json
+++ /dev/null
@@ -1,306 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2016-09-01 14:41:23.824083",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 0,
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "studying_in_same_institute",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Studying in Same Institute",
- "length": 0,
- "no_copy": 0,
- "options": "NO\nYES",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 3,
- "fieldname": "full_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Full Name",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 1,
- "fieldname": "gender",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Gender",
- "length": 0,
- "no_copy": 0,
- "options": "\nMale\nFemale",
- "permlevel": 0,
- "precision": "",
- "print_hide": 0,
- "print_hide_if_no_value": 0,
- "print_width": "",
- "read_only": 0,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_4",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.studying_in_same_institute == \"YES\"",
- "fieldname": "student",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Student ID",
- "length": 0,
- "no_copy": 0,
- "options": "Student",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 2,
- "depends_on": "eval:doc.studying_in_same_institute == \"NO\"",
- "fieldname": "institution",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Institution",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 2,
- "fieldname": "program",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Program",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 2,
- "fieldname": "date_of_birth",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Date of Birth",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2018-11-04 03:37:25.881487",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Sibling",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 0,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_sibling/student_sibling.py b/erpnext/education/doctype/student_sibling/student_sibling.py
deleted file mode 100644
index 9ee0667d14ef..000000000000
--- a/erpnext/education/doctype/student_sibling/student_sibling.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentSibling(Document):
- pass
diff --git a/erpnext/education/doctype/student_siblings/__init__.py b/erpnext/education/doctype/student_siblings/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/student_siblings/student_siblings.json b/erpnext/education/doctype/student_siblings/student_siblings.json
deleted file mode 100644
index 9d91ad2e2cb5..000000000000
--- a/erpnext/education/doctype/student_siblings/student_siblings.json
+++ /dev/null
@@ -1,141 +0,0 @@
-{
- "allow_copy": 0,
- "allow_events_in_timeline": 0,
- "allow_guest_to_view": 0,
- "allow_import": 0,
- "allow_rename": 0,
- "beta": 0,
- "creation": "2016-09-01 14:41:23.824083",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
- "fields": [
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "name1",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Name",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "gender",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Gender",
- "length": 0,
- "no_copy": 0,
- "options": "\nMale\nFemale",
- "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,
- "translatable": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_in_quick_entry": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "date_of_birth",
- "fieldtype": "Date",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Date of Birth",
- "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,
- "translatable": 0,
- "unique": 0
- }
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 0,
- "issingle": 0,
- "istable": 1,
- "max_attachments": 0,
- "modified": "2018-11-04 03:37:46.485218",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Siblings",
- "name_case": "",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "read_only": 0,
- "read_only_onload": 0,
- "restrict_to_domain": "Education",
- "show_name_in_global_search": 0,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 0,
- "track_seen": 0,
- "track_views": 0
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/student_siblings/student_siblings.py b/erpnext/education/doctype/student_siblings/student_siblings.py
deleted file mode 100644
index ee89f4f1575e..000000000000
--- a/erpnext/education/doctype/student_siblings/student_siblings.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class StudentSiblings(Document):
- pass
diff --git a/erpnext/education/doctype/topic/__init__.py b/erpnext/education/doctype/topic/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/topic/test_topic.py b/erpnext/education/doctype/topic/test_topic.py
deleted file mode 100644
index c11204a575c4..000000000000
--- a/erpnext/education/doctype/topic/test_topic.py
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-import frappe
-
-
-class TestTopic(unittest.TestCase):
- def setUp(self):
- make_topic_and_linked_content("_Test Topic 1", [{"type": "Article", "name": "_Test Article 1"}])
-
- def test_get_contents(self):
- topic = frappe.get_doc("Topic", "_Test Topic 1")
- contents = topic.get_contents()
- self.assertEqual(contents[0].doctype, "Article")
- self.assertEqual(contents[0].name, "_Test Article 1")
- frappe.db.rollback()
-
-
-def make_topic(name):
- try:
- topic = frappe.get_doc("Topic", name)
- except frappe.DoesNotExistError:
- topic = frappe.get_doc(
- {
- "doctype": "Topic",
- "topic_name": name,
- "topic_code": name,
- }
- ).insert()
- return topic.name
-
-
-def make_topic_and_linked_content(topic_name, content_dict_list):
- try:
- topic = frappe.get_doc("Topic", topic_name)
- except frappe.DoesNotExistError:
- make_topic(topic_name)
- topic = frappe.get_doc("Topic", topic_name)
- content_list = [make_content(content["type"], content["name"]) for content in content_dict_list]
- for content in content_list:
- topic.append("topic_content", {"content": content.title, "content_type": content.doctype})
- topic.save()
- return topic
-
-
-def make_content(type, name):
- try:
- content = frappe.get_doc(type, name)
- except frappe.DoesNotExistError:
- content = frappe.get_doc({"doctype": type, "title": name}).insert()
- return content
diff --git a/erpnext/education/doctype/topic/topic.js b/erpnext/education/doctype/topic/topic.js
deleted file mode 100644
index 0c903c5a56a6..000000000000
--- a/erpnext/education/doctype/topic/topic.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Topic', {
- refresh: function(frm) {
- if (!cur_frm.doc.__islocal) {
- frm.add_custom_button(__('Add to Courses'), function() {
- frm.trigger('add_topic_to_courses');
- }, __('Action'));
- }
- },
-
- add_topic_to_courses: function(frm) {
- get_courses_without_topic(frm.doc.name).then(r => {
- if (r.message.length) {
- frappe.prompt([
- {
- fieldname: 'courses',
- label: __('Courses'),
- fieldtype: 'MultiSelectPills',
- get_data: function() {
- return r.message;
- }
- }
- ],
- function(data) {
- frappe.call({
- method: 'erpnext.education.doctype.topic.topic.add_topic_to_courses',
- args: {
- 'topic': frm.doc.name,
- 'courses': data.courses
- },
- callback: function(r) {
- if (!r.exc) {
- frm.reload_doc();
- }
- },
- freeze: true,
- freeze_message: __('...Adding Topic to Courses')
- });
- }, __('Add Topic to Courses'), __('Add'));
- } else {
- frappe.msgprint(__('This topic is already added to the existing courses'));
- }
- });
- }
-});
-
-let get_courses_without_topic = function(topic) {
- return frappe.call({
- type: 'GET',
- method: 'erpnext.education.doctype.topic.topic.get_courses_without_topic',
- args: {'topic': topic}
- });
-};
diff --git a/erpnext/education/doctype/topic/topic.json b/erpnext/education/doctype/topic/topic.json
deleted file mode 100644
index 305458bf6777..000000000000
--- a/erpnext/education/doctype/topic/topic.json
+++ /dev/null
@@ -1,90 +0,0 @@
-{
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:topic_name",
- "creation": "2018-12-12 11:37:39.917760",
- "doctype": "DocType",
- "editable_grid": 1,
- "engine": "InnoDB",
- "field_order": [
- "topic_name",
- "topic_content",
- "description",
- "hero_image"
- ],
- "fields": [
- {
- "fieldname": "topic_name",
- "fieldtype": "Data",
- "in_list_view": 1,
- "label": "Name",
- "reqd": 1,
- "unique": 1
- },
- {
- "fieldname": "topic_content",
- "fieldtype": "Table",
- "label": "Topic Content",
- "options": "Topic Content"
- },
- {
- "fieldname": "hero_image",
- "fieldtype": "Attach Image",
- "hidden": 1,
- "label": "Hero Image"
- },
- {
- "fieldname": "description",
- "fieldtype": "Small Text",
- "label": "Description"
- }
- ],
- "image_field": "hero_image",
- "modified": "2019-06-12 12:34:49.911300",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Topic",
- "owner": "Administrator",
- "permissions": [
- {
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "System Manager",
- "share": 1,
- "write": 1
- },
- {
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Administrator",
- "share": 1,
- "write": 1
- },
- {
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "Instructor",
- "share": 1,
- "write": 1
- }
- ],
- "quick_entry": 1,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/topic/topic.py b/erpnext/education/doctype/topic/topic.py
deleted file mode 100644
index 6dd965552b16..000000000000
--- a/erpnext/education/doctype/topic/topic.py
+++ /dev/null
@@ -1,76 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-import json
-
-import frappe
-from frappe import _
-from frappe.model.document import Document
-
-
-class Topic(Document):
- def get_contents(self):
- try:
- topic_content_list = self.topic_content
- content_data = [
- frappe.get_doc(topic_content.content_type, topic_content.content)
- for topic_content in topic_content_list
- ]
- except Exception as e:
- frappe.log_error(frappe.get_traceback())
- return None
- return content_data
-
-
-@frappe.whitelist()
-def get_courses_without_topic(topic):
- data = []
- for entry in frappe.db.get_all("Course"):
- course = frappe.get_doc("Course", entry.name)
- topics = [t.topic for t in course.topics]
- if not topics or topic not in topics:
- data.append(course.name)
- return data
-
-
-@frappe.whitelist()
-def add_topic_to_courses(topic, courses, mandatory=False):
- courses = json.loads(courses)
- for entry in courses:
- course = frappe.get_doc("Course", entry)
- course.append("topics", {"topic": topic, "topic_name": topic})
- course.flags.ignore_mandatory = True
- course.save()
- frappe.db.commit()
- frappe.msgprint(
- _("Topic {0} has been added to all the selected courses successfully.").format(
- frappe.bold(topic)
- ),
- title=_("Courses updated"),
- indicator="green",
- )
-
-
-@frappe.whitelist()
-def add_content_to_topics(content_type, content, topics):
- topics = json.loads(topics)
- for entry in topics:
- topic = frappe.get_doc("Topic", entry)
- topic.append(
- "topic_content",
- {
- "content_type": content_type,
- "content": content,
- },
- )
- topic.flags.ignore_mandatory = True
- topic.save()
- frappe.db.commit()
- frappe.msgprint(
- _("{0} {1} has been added to all the selected topics successfully.").format(
- content_type, frappe.bold(content)
- ),
- title=_("Topics updated"),
- indicator="green",
- )
diff --git a/erpnext/education/doctype/topic_content/__init__.py b/erpnext/education/doctype/topic_content/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/doctype/topic_content/test_topic_content.py b/erpnext/education/doctype/topic_content/test_topic_content.py
deleted file mode 100644
index 56bb40968cad..000000000000
--- a/erpnext/education/doctype/topic_content/test_topic_content.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-
-import unittest
-
-
-class TestTopicContent(unittest.TestCase):
- pass
diff --git a/erpnext/education/doctype/topic_content/topic_content.js b/erpnext/education/doctype/topic_content/topic_content.js
deleted file mode 100644
index 9cda0cabb2a1..000000000000
--- a/erpnext/education/doctype/topic_content/topic_content.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.ui.form.on('Topic Content', {
- refresh: function(frm) {
-
- }
-});
diff --git a/erpnext/education/doctype/topic_content/topic_content.json b/erpnext/education/doctype/topic_content/topic_content.json
deleted file mode 100644
index 444fd1d07c0d..000000000000
--- a/erpnext/education/doctype/topic_content/topic_content.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "creation": "2018-12-12 11:42:57.987434",
- "doctype": "DocType",
- "editable_grid": 1,
- "engine": "InnoDB",
- "field_order": [
- "content_type",
- "column_break_2",
- "content"
- ],
- "fields": [
- {
- "fieldname": "content_type",
- "fieldtype": "Select",
- "in_list_view": 1,
- "label": "Content Type",
- "options": "\nArticle\nVideo\nQuiz",
- "reqd": 1
- },
- {
- "fieldname": "column_break_2",
- "fieldtype": "Column Break"
- },
- {
- "fieldname": "content",
- "fieldtype": "Dynamic Link",
- "in_list_view": 1,
- "label": "Content",
- "options": "content_type",
- "reqd": 1
- }
- ],
- "istable": 1,
- "modified": "2019-05-14 11:12:49.153771",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Topic Content",
- "owner": "Administrator",
- "permissions": [],
- "quick_entry": 1,
- "sort_field": "modified",
- "sort_order": "DESC",
- "track_changes": 1
-}
\ No newline at end of file
diff --git a/erpnext/education/doctype/topic_content/topic_content.py b/erpnext/education/doctype/topic_content/topic_content.py
deleted file mode 100644
index 88d0eee73ab8..000000000000
--- a/erpnext/education/doctype/topic_content/topic_content.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from frappe.model.document import Document
-
-
-class TopicContent(Document):
- pass
diff --git a/erpnext/education/education_dashboard/education/education.json b/erpnext/education/education_dashboard/education/education.json
deleted file mode 100644
index 41d33758b9bf..000000000000
--- a/erpnext/education/education_dashboard/education/education.json
+++ /dev/null
@@ -1,62 +0,0 @@
-{
- "cards": [
- {
- "card": "Total Students"
- },
- {
- "card": "Total Instructors"
- },
- {
- "card": "Program Enrollments"
- },
- {
- "card": "Student Applicants to Review"
- }
- ],
- "charts": [
- {
- "chart": "Program Enrollments",
- "width": "Full"
- },
- {
- "chart": "Program wise Enrollment",
- "width": "Half"
- },
- {
- "chart": "Course wise Enrollment",
- "width": "Half"
- },
- {
- "chart": "Course wise Student Count",
- "width": "Half"
- },
- {
- "chart": "Student Category wise Program Enrollments",
- "width": "Half"
- },
- {
- "chart": "Student Gender Diversity Ratio",
- "width": "Half"
- },
- {
- "chart": "Instructor Gender Diversity Ratio",
- "width": "Half"
- },
- {
- "chart": "Program wise Fee Collection",
- "width": "Full"
- }
- ],
- "creation": "2020-07-22 18:51:02.195762",
- "dashboard_name": "Education",
- "docstatus": 0,
- "doctype": "Dashboard",
- "idx": 0,
- "is_default": 0,
- "is_standard": 1,
- "modified": "2020-08-05 16:22:17.428101",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Education",
- "owner": "Administrator"
-}
\ No newline at end of file
diff --git a/erpnext/education/module_onboarding/education/education.json b/erpnext/education/module_onboarding/education/education.json
deleted file mode 100644
index e5f0fec3d13e..000000000000
--- a/erpnext/education/module_onboarding/education/education.json
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "allow_roles": [
- {
- "role": "Education Manager"
- }
- ],
- "creation": "2020-07-27 19:02:49.561391",
- "docstatus": 0,
- "doctype": "Module Onboarding",
- "documentation_url": "https://docs.erpnext.com/docs/user/manual/en/education",
- "idx": 0,
- "is_complete": 0,
- "modified": "2020-07-27 21:10:46.722961",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Education",
- "owner": "Administrator",
- "steps": [
- {
- "step": "Create a Student"
- },
- {
- "step": "Create an Instructor"
- },
- {
- "step": "Introduction to Program and Courses"
- },
- {
- "step": "Create a Topic"
- },
- {
- "step": "Create a Course"
- },
- {
- "step": "Create a Program"
- },
- {
- "step": "Enroll a Student in a Program"
- },
- {
- "step": "Introduction to Student Group"
- },
- {
- "step": "Introduction to Student Attendance"
- }
- ],
- "subtitle": "Students, Instructors, Programs and more.",
- "success_message": "The Education Module is all set up!",
- "title": "Let's Set Up the Education Module."
-}
diff --git a/erpnext/education/number_card/program_enrollments/program_enrollments.json b/erpnext/education/number_card/program_enrollments/program_enrollments.json
deleted file mode 100644
index 5847679ddd1d..000000000000
--- a/erpnext/education/number_card/program_enrollments/program_enrollments.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "aggregate_function_based_on": "",
- "creation": "2020-07-27 18:26:27.005186",
- "docstatus": 0,
- "doctype": "Number Card",
- "document_type": "Program Enrollment",
- "dynamic_filters_json": "[]",
- "filters_json": "[[\"Program Enrollment\",\"docstatus\",\"=\",\"1\",false],[\"Program Enrollment\",\"enrollment_date\",\"Timespan\",\"this year\",false]]",
- "function": "Count",
- "idx": 0,
- "is_public": 1,
- "is_standard": 1,
- "label": "Program Enrollments",
- "modified": "2020-07-27 18:26:32.512624",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Program Enrollments",
- "owner": "Administrator",
- "report_function": "Sum",
- "show_percentage_stats": 1,
- "stats_time_interval": "Yearly",
- "type": "Document Type"
-}
\ No newline at end of file
diff --git a/erpnext/education/number_card/student_applicants_to_review/student_applicants_to_review.json b/erpnext/education/number_card/student_applicants_to_review/student_applicants_to_review.json
deleted file mode 100644
index 258667a2d455..000000000000
--- a/erpnext/education/number_card/student_applicants_to_review/student_applicants_to_review.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "aggregate_function_based_on": "",
- "creation": "2020-07-27 18:42:33.366862",
- "docstatus": 0,
- "doctype": "Number Card",
- "document_type": "Student Applicant",
- "dynamic_filters_json": "[]",
- "filters_json": "[[\"Student Applicant\",\"application_status\",\"=\",\"Applied\",false]]",
- "function": "Count",
- "idx": 0,
- "is_public": 1,
- "is_standard": 1,
- "label": "Student Applicants to Review",
- "modified": "2020-07-27 18:42:42.739710",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Applicants to Review",
- "owner": "Administrator",
- "report_function": "Sum",
- "show_percentage_stats": 1,
- "stats_time_interval": "Monthly",
- "type": "Document Type"
-}
\ No newline at end of file
diff --git a/erpnext/education/number_card/total_instructors/total_instructors.json b/erpnext/education/number_card/total_instructors/total_instructors.json
deleted file mode 100644
index b8d3cc0fdffd..000000000000
--- a/erpnext/education/number_card/total_instructors/total_instructors.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "aggregate_function_based_on": "",
- "creation": "2020-07-23 14:19:38.423190",
- "docstatus": 0,
- "doctype": "Number Card",
- "document_type": "Instructor",
- "dynamic_filters_json": "[]",
- "filters_json": "[[\"Instructor\",\"status\",\"=\",\"Active\",false]]",
- "function": "Count",
- "idx": 0,
- "is_public": 1,
- "is_standard": 1,
- "label": "Total Instructors",
- "modified": "2020-07-23 14:19:47.623306",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Total Instructors",
- "owner": "Administrator",
- "report_function": "Sum",
- "show_percentage_stats": 1,
- "stats_time_interval": "Monthly",
- "type": "Document Type"
-}
\ No newline at end of file
diff --git a/erpnext/education/number_card/total_students/total_students.json b/erpnext/education/number_card/total_students/total_students.json
deleted file mode 100644
index 109c3d8ad91c..000000000000
--- a/erpnext/education/number_card/total_students/total_students.json
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "aggregate_function_based_on": "",
- "creation": "2020-07-23 14:18:07.732298",
- "docstatus": 0,
- "doctype": "Number Card",
- "document_type": "Student",
- "dynamic_filters_json": "[]",
- "filters_json": "[[\"Student\",\"enabled\",\"=\",1,false]]",
- "function": "Count",
- "idx": 0,
- "is_public": 1,
- "is_standard": 1,
- "label": "Total Students",
- "modified": "2020-07-23 14:18:40.603947",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Total Students",
- "owner": "Administrator",
- "report_function": "Sum",
- "show_percentage_stats": 1,
- "stats_time_interval": "Monthly",
- "type": "Document Type"
-}
\ No newline at end of file
diff --git a/erpnext/education/onboarding_step/create_a_course/create_a_course.json b/erpnext/education/onboarding_step/create_a_course/create_a_course.json
deleted file mode 100644
index 02eee1405698..000000000000
--- a/erpnext/education/onboarding_step/create_a_course/create_a_course.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "action": "Create Entry",
- "creation": "2020-07-27 19:09:04.493932",
- "docstatus": 0,
- "doctype": "Onboarding Step",
- "idx": 0,
- "is_complete": 0,
- "is_mandatory": 0,
- "is_single": 0,
- "is_skipped": 0,
- "modified": "2020-07-27 19:09:04.493932",
- "modified_by": "Administrator",
- "name": "Create a Course",
- "owner": "Administrator",
- "reference_document": "Course",
- "show_full_form": 1,
- "title": "Create a Course",
- "validate_action": 1
-}
\ No newline at end of file
diff --git a/erpnext/education/onboarding_step/create_a_program/create_a_program.json b/erpnext/education/onboarding_step/create_a_program/create_a_program.json
deleted file mode 100644
index 61726304e0ff..000000000000
--- a/erpnext/education/onboarding_step/create_a_program/create_a_program.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "action": "Create Entry",
- "creation": "2020-07-27 19:09:35.451945",
- "docstatus": 0,
- "doctype": "Onboarding Step",
- "idx": 0,
- "is_complete": 0,
- "is_mandatory": 0,
- "is_single": 0,
- "is_skipped": 0,
- "modified": "2020-07-27 19:09:35.451945",
- "modified_by": "Administrator",
- "name": "Create a Program",
- "owner": "Administrator",
- "reference_document": "Program",
- "show_full_form": 1,
- "title": "Create a Program",
- "validate_action": 1
-}
\ No newline at end of file
diff --git a/erpnext/education/onboarding_step/create_a_student/create_a_student.json b/erpnext/education/onboarding_step/create_a_student/create_a_student.json
deleted file mode 100644
index 07c3f7331e01..000000000000
--- a/erpnext/education/onboarding_step/create_a_student/create_a_student.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "action": "Create Entry",
- "creation": "2020-07-27 19:17:20.326837",
- "docstatus": 0,
- "doctype": "Onboarding Step",
- "idx": 0,
- "is_complete": 0,
- "is_mandatory": 1,
- "is_single": 0,
- "is_skipped": 0,
- "modified": "2020-07-27 19:49:47.724289",
- "modified_by": "Administrator",
- "name": "Create a Student",
- "owner": "Administrator",
- "reference_document": "Student",
- "show_full_form": 1,
- "title": "Create a Student",
- "validate_action": 1
-}
\ No newline at end of file
diff --git a/erpnext/education/onboarding_step/create_a_topic/create_a_topic.json b/erpnext/education/onboarding_step/create_a_topic/create_a_topic.json
deleted file mode 100644
index 96a536488e5e..000000000000
--- a/erpnext/education/onboarding_step/create_a_topic/create_a_topic.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "action": "Create Entry",
- "creation": "2020-07-27 19:08:40.754534",
- "docstatus": 0,
- "doctype": "Onboarding Step",
- "idx": 0,
- "is_complete": 0,
- "is_mandatory": 0,
- "is_single": 0,
- "is_skipped": 0,
- "modified": "2020-07-27 19:09:13.231995",
- "modified_by": "Administrator",
- "name": "Create a Topic",
- "owner": "Administrator",
- "reference_document": "Topic",
- "show_full_form": 1,
- "title": "Create a Topic",
- "validate_action": 1
-}
\ No newline at end of file
diff --git a/erpnext/education/onboarding_step/create_an_instructor/create_an_instructor.json b/erpnext/education/onboarding_step/create_an_instructor/create_an_instructor.json
deleted file mode 100644
index 419d6e07f160..000000000000
--- a/erpnext/education/onboarding_step/create_an_instructor/create_an_instructor.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "action": "Create Entry",
- "creation": "2020-07-27 19:17:39.158037",
- "docstatus": 0,
- "doctype": "Onboarding Step",
- "idx": 0,
- "is_complete": 0,
- "is_mandatory": 1,
- "is_single": 0,
- "is_skipped": 0,
- "modified": "2020-07-27 19:49:47.723494",
- "modified_by": "Administrator",
- "name": "Create an Instructor",
- "owner": "Administrator",
- "reference_document": "Instructor",
- "show_full_form": 1,
- "title": "Create an Instructor",
- "validate_action": 1
-}
\ No newline at end of file
diff --git a/erpnext/education/onboarding_step/enroll_a_student_in_a_program/enroll_a_student_in_a_program.json b/erpnext/education/onboarding_step/enroll_a_student_in_a_program/enroll_a_student_in_a_program.json
deleted file mode 100644
index 61e48cd52067..000000000000
--- a/erpnext/education/onboarding_step/enroll_a_student_in_a_program/enroll_a_student_in_a_program.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "action": "Create Entry",
- "creation": "2020-07-27 19:10:28.530226",
- "docstatus": 0,
- "doctype": "Onboarding Step",
- "idx": 0,
- "is_complete": 0,
- "is_mandatory": 0,
- "is_single": 0,
- "is_skipped": 0,
- "modified": "2020-07-27 19:10:28.530226",
- "modified_by": "Administrator",
- "name": "Enroll a Student in a Program",
- "owner": "Administrator",
- "reference_document": "Program Enrollment",
- "show_full_form": 0,
- "title": "Enroll a Student in a Program",
- "validate_action": 1
-}
\ No newline at end of file
diff --git a/erpnext/education/onboarding_step/introduction_to_program_and_courses/introduction_to_program_and_courses.json b/erpnext/education/onboarding_step/introduction_to_program_and_courses/introduction_to_program_and_courses.json
deleted file mode 100644
index a9ddfc00da41..000000000000
--- a/erpnext/education/onboarding_step/introduction_to_program_and_courses/introduction_to_program_and_courses.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "action": "Watch Video",
- "creation": "2020-07-27 19:05:12.663987",
- "docstatus": 0,
- "doctype": "Onboarding Step",
- "idx": 0,
- "is_complete": 0,
- "is_mandatory": 0,
- "is_single": 0,
- "is_skipped": 0,
- "modified": "2020-07-27 20:18:11.831789",
- "modified_by": "Administrator",
- "name": "Introduction to Program and Courses",
- "owner": "Administrator",
- "show_full_form": 0,
- "title": "Introduction to Program and Courses",
- "validate_action": 1,
- "video_url": "https://www.youtube.com/watch?v=1ueE4seFTp8"
-}
\ No newline at end of file
diff --git a/erpnext/education/onboarding_step/introduction_to_student_attendance/introduction_to_student_attendance.json b/erpnext/education/onboarding_step/introduction_to_student_attendance/introduction_to_student_attendance.json
deleted file mode 100644
index 3de99728ea34..000000000000
--- a/erpnext/education/onboarding_step/introduction_to_student_attendance/introduction_to_student_attendance.json
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "action": "Watch Video",
- "creation": "2020-07-27 19:14:57.176131",
- "docstatus": 0,
- "doctype": "Onboarding Step",
- "idx": 0,
- "is_complete": 0,
- "is_mandatory": 0,
- "is_single": 0,
- "is_skipped": 0,
- "modified": "2020-07-27 19:55:55.411032",
- "modified_by": "Administrator",
- "name": "Introduction to Student Attendance",
- "owner": "Administrator",
- "show_full_form": 0,
- "title": "Introduction to Student Attendance",
- "validate_action": 1,
- "video_url": "https://youtu.be/j9pgkPuyiaI"
-}
\ No newline at end of file
diff --git a/erpnext/education/onboarding_step/introduction_to_student_group/introduction_to_student_group.json b/erpnext/education/onboarding_step/introduction_to_student_group/introduction_to_student_group.json
deleted file mode 100644
index 74bdcd17be67..000000000000
--- a/erpnext/education/onboarding_step/introduction_to_student_group/introduction_to_student_group.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "action": "Watch Video",
- "creation": "2020-07-27 19:12:05.046465",
- "docstatus": 0,
- "doctype": "Onboarding Step",
- "idx": 0,
- "is_complete": 0,
- "is_mandatory": 0,
- "is_single": 0,
- "is_skipped": 0,
- "modified": "2020-07-27 19:42:47.286441",
- "modified_by": "Administrator",
- "name": "Introduction to Student Group",
- "owner": "Administrator",
- "reference_document": "Student Group",
- "show_full_form": 0,
- "title": "Introduction to Student Group",
- "validate_action": 1,
- "video_url": "https://youtu.be/5K_smeeE1Q4"
-}
\ No newline at end of file
diff --git a/erpnext/education/report/__init__.py b/erpnext/education/report/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/absent_student_report/__init__.py b/erpnext/education/report/absent_student_report/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/absent_student_report/absent_student_report.js b/erpnext/education/report/absent_student_report/absent_student_report.js
deleted file mode 100644
index bf2d10d59e31..000000000000
--- a/erpnext/education/report/absent_student_report/absent_student_report.js
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt
-
-
-frappe.query_reports["Absent Student Report"] = {
- "filters": [
- {
- "fieldname":"date",
- "label": __("Date"),
- "fieldtype": "Date",
- "default": frappe.datetime.get_today(),
- "reqd": 1
- }
- ]
-}
diff --git a/erpnext/education/report/absent_student_report/absent_student_report.json b/erpnext/education/report/absent_student_report/absent_student_report.json
deleted file mode 100644
index 92ad860cc65a..000000000000
--- a/erpnext/education/report/absent_student_report/absent_student_report.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "add_total_row": 0,
- "creation": "2013-05-13 14:04:03",
- "disable_prepared_report": 0,
- "disabled": 0,
- "docstatus": 0,
- "doctype": "Report",
- "idx": 3,
- "is_standard": "Yes",
- "modified": "2020-06-24 17:16:40.251116",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Absent Student Report",
- "owner": "Administrator",
- "prepared_report": 0,
- "ref_doctype": "Student Attendance",
- "report_name": "Absent Student Report",
- "report_type": "Script Report",
- "roles": [
- {
- "role": "Academics User"
- }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/education/report/absent_student_report/absent_student_report.py b/erpnext/education/report/absent_student_report/absent_student_report.py
deleted file mode 100644
index ac27f715ec90..000000000000
--- a/erpnext/education/report/absent_student_report/absent_student_report.py
+++ /dev/null
@@ -1,132 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-
-import frappe
-from frappe import _, msgprint
-from frappe.utils import formatdate
-
-from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list
-from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday
-
-
-def execute(filters=None):
- if not filters:
- filters = {}
-
- if not filters.get("date"):
- msgprint(_("Please select date"), raise_exception=1)
-
- columns = get_columns(filters)
- date = filters.get("date")
-
- holiday_list = get_holiday_list()
- if is_holiday(holiday_list, filters.get("date")):
- msgprint(
- _("No attendance has been marked for {0} as it is a Holiday").format(
- frappe.bold(formatdate(filters.get("date")))
- )
- )
-
- absent_students = get_absent_students(date)
- leave_applicants = get_leave_applications(date)
- if absent_students:
- student_list = [d["student"] for d in absent_students]
- transportation_details = get_transportation_details(date, student_list)
-
- data = []
- for student in absent_students:
- if not student.student in leave_applicants:
- row = [student.student, student.student_name, student.student_group]
- stud_details = frappe.db.get_value(
- "Student", student.student, ["student_email_id", "student_mobile_number"], as_dict=True
- )
-
- if stud_details.student_email_id:
- row += [stud_details.student_email_id]
- else:
- row += [""]
-
- if stud_details.student_mobile_number:
- row += [stud_details.student_mobile_number]
- else:
- row += [""]
- if transportation_details.get(student.student):
- row += transportation_details.get(student.student)
-
- data.append(row)
-
- return columns, data
-
-
-def get_columns(filters):
- columns = [
- _("Student") + ":Link/Student:90",
- _("Student Name") + "::150",
- _("Student Group") + "::180",
- _("Student Email Address") + "::180",
- _("Student Mobile No.") + "::150",
- _("Mode of Transportation") + "::150",
- _("Vehicle/Bus Number") + "::150",
- ]
- return columns
-
-
-def get_absent_students(date):
- absent_students = frappe.db.sql(
- """
- SELECT student, student_name, student_group
- FROM `tabStudent Attendance`
- WHERE
- status='Absent' and docstatus=1 and date = %s
- ORDER BY
- student_group, student_name""",
- date,
- as_dict=1,
- )
- return absent_students
-
-
-def get_leave_applications(date):
- leave_applicants = []
- leave_applications = frappe.db.sql(
- """
- SELECT student
- FROM
- `tabStudent Leave Application`
- WHERE
- docstatus = 1 and mark_as_present = 1 and
- from_date <= %s and to_date >= %s
- """,
- (date, date),
- )
- for student in leave_applications:
- leave_applicants.append(student[0])
-
- return leave_applicants
-
-
-def get_transportation_details(date, student_list):
- academic_year = frappe.get_all(
- "Academic Year", filters=[["year_start_date", "<=", date], ["year_end_date", ">=", date]]
- )
- if academic_year:
- academic_year = academic_year[0].name
- elif frappe.defaults.get_defaults().academic_year:
- academic_year = frappe.defaults.get_defaults().academic_year
- else:
- return {}
-
- transportation_details = frappe.get_all(
- "Program Enrollment",
- fields=["student", "mode_of_transportation", "vehicle_no"],
- filters={
- "student": ("in", student_list),
- "academic_year": academic_year,
- "docstatus": ("not in", ["2"]),
- },
- )
- transportation_map = {}
- for d in transportation_details:
- transportation_map[d.student] = [d.mode_of_transportation, d.vehicle_no]
- return transportation_map
diff --git a/erpnext/education/report/assessment_plan_status/__init__.py b/erpnext/education/report/assessment_plan_status/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/assessment_plan_status/assessment_plan_status.js b/erpnext/education/report/assessment_plan_status/assessment_plan_status.js
deleted file mode 100644
index 2d1eb0964051..000000000000
--- a/erpnext/education/report/assessment_plan_status/assessment_plan_status.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-/* eslint-disable */
-
-frappe.query_reports["Assessment Plan Status"] = {
- "filters": [
- {
- "fieldname":"assessment_group",
- "label": __("Assessment Group"),
- "fieldtype": "Link",
- "options": "Assessment Group",
- "get_query": function() {
- return{
- filters: {
- 'is_group': 0
- }
- };
- }
- },
- {
- "fieldname":"schedule_date",
- "label": __("Scheduled Upto"),
- "fieldtype": "Date",
- "options": ""
- }
-
- ]
-}
diff --git a/erpnext/education/report/assessment_plan_status/assessment_plan_status.json b/erpnext/education/report/assessment_plan_status/assessment_plan_status.json
deleted file mode 100644
index cbca648d572c..000000000000
--- a/erpnext/education/report/assessment_plan_status/assessment_plan_status.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "add_total_row": 0,
- "creation": "2017-11-09 15:07:30.404428",
- "disable_prepared_report": 0,
- "disabled": 0,
- "docstatus": 0,
- "doctype": "Report",
- "idx": 0,
- "is_standard": "Yes",
- "modified": "2020-06-24 17:16:02.027410",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Assessment Plan Status",
- "owner": "Administrator",
- "prepared_report": 0,
- "ref_doctype": "Assessment Plan",
- "report_name": "Assessment Plan Status",
- "report_type": "Script Report",
- "roles": [
- {
- "role": "Academics User"
- }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/education/report/assessment_plan_status/assessment_plan_status.py b/erpnext/education/report/assessment_plan_status/assessment_plan_status.py
deleted file mode 100644
index 7cf5b30548a7..000000000000
--- a/erpnext/education/report/assessment_plan_status/assessment_plan_status.py
+++ /dev/null
@@ -1,187 +0,0 @@
-# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from itertools import groupby
-
-import frappe
-from frappe import _
-from frappe.utils import cint
-
-DOCSTATUS = {
- 0: "saved",
- 1: "submitted",
-}
-
-
-def execute(filters=None):
- columns, data = [], []
-
- args = frappe._dict()
- args["assessment_group"] = filters.get("assessment_group")
- args["schedule_date"] = filters.get("schedule_date")
-
- columns = get_column()
-
- data, chart = get_assessment_data(args)
-
- return columns, data, None, chart
-
-
-def get_assessment_data(args=None):
-
- # [total, saved, submitted, remaining]
- chart_data = [0, 0, 0, 0]
-
- condition = ""
- if args["assessment_group"]:
- condition += "and assessment_group = %(assessment_group)s"
- if args["schedule_date"]:
- condition += "and schedule_date <= %(schedule_date)s"
-
- assessment_plan = frappe.db.sql(
- """
- SELECT
- ap.name as assessment_plan,
- ap.assessment_name,
- ap.student_group,
- ap.schedule_date,
- (select count(*) from `tabStudent Group Student` sgs where sgs.parent=ap.student_group)
- as student_group_strength
- FROM
- `tabAssessment Plan` ap
- WHERE
- ap.docstatus = 1 {condition}
- ORDER BY
- ap.modified desc
- """.format(
- condition=condition
- ),
- (args),
- as_dict=1,
- )
-
- assessment_plan_list = [d.assessment_plan for d in assessment_plan] if assessment_plan else [""]
- assessment_result = get_assessment_result(assessment_plan_list)
-
- for d in assessment_plan:
-
- assessment_plan_details = assessment_result.get(d.assessment_plan)
- assessment_plan_details = (
- frappe._dict() if not assessment_plan_details else frappe._dict(assessment_plan_details)
- )
- if "saved" not in assessment_plan_details:
- assessment_plan_details.update({"saved": 0})
- if "submitted" not in assessment_plan_details:
- assessment_plan_details.update({"submitted": 0})
-
- # remaining students whose marks not entered
- remaining_students = (
- cint(d.student_group_strength)
- - cint(assessment_plan_details.saved)
- - cint(assessment_plan_details.submitted)
- )
- assessment_plan_details.update({"remaining": remaining_students})
- d.update(assessment_plan_details)
-
- chart_data[0] += cint(d.student_group_strength)
- chart_data[1] += assessment_plan_details.saved
- chart_data[2] += assessment_plan_details.submitted
- chart_data[3] += assessment_plan_details.remaining
-
- chart = get_chart(chart_data[1:])
-
- return assessment_plan, chart
-
-
-def get_assessment_result(assessment_plan_list):
- assessment_result_dict = frappe._dict()
-
- assessment_result = frappe.db.sql(
- """
- SELECT
- assessment_plan, docstatus, count(*) as count
- FROM
- `tabAssessment Result`
- WHERE
- assessment_plan in (%s)
- GROUP BY
- assessment_plan, docstatus
- ORDER BY
- assessment_plan
- """
- % ", ".join(["%s"] * len(assessment_plan_list)),
- tuple(assessment_plan_list),
- as_dict=1,
- )
-
- for key, group in groupby(assessment_result, lambda ap: ap["assessment_plan"]):
- tmp = {}
- for d in group:
- if d.docstatus in [0, 1]:
- tmp.update({DOCSTATUS[d.docstatus]: d.count})
- assessment_result_dict[key] = tmp
-
- return assessment_result_dict
-
-
-def get_chart(chart_data):
- return {
- "data": {"labels": ["Saved", "Submitted", "Remaining"], "datasets": [{"values": chart_data}]},
- "type": "percentage",
- }
-
-
-def get_column():
- return [
- {
- "fieldname": "assessment_plan",
- "label": _("Assessment Plan"),
- "fieldtype": "Link",
- "options": "Assessment Plan",
- "width": 120,
- },
- {
- "fieldname": "assessment_name",
- "label": _("Assessment Plan Name"),
- "fieldtype": "Data",
- "options": "",
- "width": 200,
- },
- {
- "fieldname": "schedule_date",
- "label": _("Schedule Date"),
- "fieldtype": "Date",
- "options": "",
- "width": 100,
- },
- {
- "fieldname": "student_group",
- "label": _("Student Group"),
- "fieldtype": "Link",
- "options": "Student Group",
- "width": 200,
- },
- {
- "fieldname": "student_group_strength",
- "label": _("Total Student"),
- "fieldtype": "Data",
- "options": "",
- "width": 100,
- },
- {
- "fieldname": "submitted",
- "label": _("Submitted"),
- "fieldtype": "Data",
- "options": "",
- "width": 100,
- },
- {"fieldname": "saved", "label": _("Saved"), "fieldtype": "Data", "options": "", "width": 100},
- {
- "fieldname": "remaining",
- "label": _("Remaining"),
- "fieldtype": "Data",
- "options": "",
- "width": 100,
- },
- ]
diff --git a/erpnext/education/report/course_wise_assessment_report/__init__.py b/erpnext/education/report/course_wise_assessment_report/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.html b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.html
deleted file mode 100644
index 33e725f08b6b..000000000000
--- a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.html
+++ /dev/null
@@ -1,50 +0,0 @@
-{%
- var letterhead = filters.letter_head || (frappe.get_doc(":Company", filters.company) && frappe.get_doc(":Company", filters.company).default_letter_head) || frappe.defaults.get_default("letter_head");
- var report_columns = report.get_columns_for_print();
-%}
-{% if(letterhead) { %}
-
- {%= frappe.boot.letter_heads[letterhead].header %}
-
-{% } %}
-
{%= __("Assessment Report") %}
-
-
{%= __("Academic Year: ") %} {%= filters.academic_year %}
-{% if (filters.academic_term){ %}
-
{%= __("Academic Term: ") %} {%= filters.academic_term %}
-{% } %}
-
{%= __("Course Code: ") %} {%= filters.course %}
-
{%= __("Assessment Group: ") %} {%= filters.assessment_group %}
-{% if (filters.student_group){ %}
-
{%= __("Student Group: ") %} {%= filters.student_group %}
-{% } %}
-
-
-
-
-
- {% for(var i=1, l=report_columns.length; i{%= report_columns[i].label %}
- {% } %}
-
-
-
- {% for(var j=0, k=data.length; j
- {% for(var i=1, l=report_columns.length; i
- {% var fieldname = report_columns[i].fieldname; %}
- {% if (!is_null(row[fieldname])) { %}
- {%= row[fieldname] %}
- {% } %}
-
- {% } %}
-
- {% } %}
-
-
-
-
Printed On {%= frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) %}
diff --git a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.js b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.js
deleted file mode 100644
index 8c42d48641b5..000000000000
--- a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.js
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.query_reports["Course wise Assessment Report"] = {
- "filters": [
- {
- "fieldname":"academic_year",
- "label": __("Academic Year"),
- "fieldtype": "Link",
- "options": "Academic Year",
- "reqd": 1
- },
- {
- "fieldname":"academic_term",
- "label": __("Academic Term"),
- "fieldtype": "Link",
- "options": "Academic Term"
- },
- {
- "fieldname":"course",
- "label": __("Course"),
- "fieldtype": "Link",
- "options": "Course",
- "reqd": 1
- },
- {
- "fieldname":"student_group",
- "label": __("Student Group"),
- "fieldtype": "Link",
- "options": "Student Group"
- },
- {
- "fieldname":"assessment_group",
- "label": __("Assessment Group"),
- "fieldtype": "Link",
- "options": "Assessment Group",
- "reqd": 1
- }
- ]
-};
diff --git a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.json b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.json
deleted file mode 100644
index 416db9d00f35..000000000000
--- a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "add_total_row": 0,
- "creation": "2017-05-05 14:46:13.776133",
- "disable_prepared_report": 0,
- "disabled": 0,
- "docstatus": 0,
- "doctype": "Report",
- "idx": 0,
- "is_standard": "Yes",
- "modified": "2020-06-24 17:15:15.477530",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Course wise Assessment Report",
- "owner": "Administrator",
- "prepared_report": 0,
- "query": "",
- "ref_doctype": "Assessment Result",
- "report_name": "Course wise Assessment Report",
- "report_type": "Script Report",
- "roles": [
- {
- "role": "Instructor"
- },
- {
- "role": "Education Manager"
- }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py b/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py
deleted file mode 100644
index 0930882e4034..000000000000
--- a/erpnext/education/report/course_wise_assessment_report/course_wise_assessment_report.py
+++ /dev/null
@@ -1,303 +0,0 @@
-# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from collections import OrderedDict, defaultdict
-
-import frappe
-from frappe import _
-
-from erpnext.education.api import get_grade
-
-
-def execute(filters=None):
- data, chart, grades = [], [], []
- args = frappe._dict()
- grade_wise_analysis = defaultdict(dict)
-
- args["academic_year"] = filters.get("academic_year")
- args["course"] = filters.get("course")
- args["assessment_group"] = filters.get("assessment_group")
-
- args["academic_term"] = filters.get("academic_term")
- args["student_group"] = filters.get("student_group")
-
- if args["assessment_group"] == "All Assessment Groups":
- frappe.throw(_("Please select the assessment group other than 'All Assessment Groups'"))
-
- returned_values = get_formatted_result(args, get_assessment_criteria=True)
- student_dict = returned_values["student_details"]
- result_dict = returned_values["assessment_result"]
- assessment_criteria_dict = returned_values["assessment_criteria"]
-
- for student in result_dict:
- student_row = {}
- student_row["student"] = student
- student_row["student_name"] = student_dict[student]
- for criteria in assessment_criteria_dict:
- scrub_criteria = frappe.scrub(criteria)
- if criteria in result_dict[student][args.course][args.assessment_group]:
- student_row[scrub_criteria] = result_dict[student][args.course][args.assessment_group][
- criteria
- ]["grade"]
- student_row[scrub_criteria + "_score"] = result_dict[student][args.course][
- args.assessment_group
- ][criteria]["score"]
-
- # create the list of possible grades
- if student_row[scrub_criteria] not in grades:
- grades.append(student_row[scrub_criteria])
-
- # create the dict of for gradewise analysis
- if student_row[scrub_criteria] not in grade_wise_analysis[criteria]:
- grade_wise_analysis[criteria][student_row[scrub_criteria]] = 1
- else:
- grade_wise_analysis[criteria][student_row[scrub_criteria]] += 1
- else:
- student_row[frappe.scrub(criteria)] = ""
- student_row[frappe.scrub(criteria) + "_score"] = ""
- data.append(student_row)
-
- assessment_criteria_list = [d for d in assessment_criteria_dict]
- columns = get_column(assessment_criteria_dict)
- chart = get_chart_data(grades, assessment_criteria_list, grade_wise_analysis)
-
- return columns, data, None, chart
-
-
-def get_formatted_result(
- args, get_assessment_criteria=False, get_course=False, get_all_assessment_groups=False
-):
- cond, cond1, cond2, cond3, cond4 = " ", " ", " ", " ", " "
- args_list = [args.academic_year]
-
- if args.course:
- cond = " and ar.course=%s"
- args_list.append(args.course)
-
- if args.academic_term:
- cond1 = " and ar.academic_term=%s"
- args_list.append(args.academic_term)
-
- if args.student_group:
- cond2 = " and ar.student_group=%s"
- args_list.append(args.student_group)
-
- create_total_dict = False
-
- assessment_groups = get_child_assessment_groups(args.assessment_group)
- cond3 = " and ar.assessment_group in (%s)" % (", ".join(["%s"] * len(assessment_groups)))
- args_list += assessment_groups
-
- if args.students:
- cond4 = " and ar.student in (%s)" % (", ".join(["%s"] * len(args.students)))
- args_list += args.students
-
- assessment_result = frappe.db.sql(
- """
- SELECT
- ar.student, ar.student_name, ar.academic_year, ar.academic_term, ar.program, ar.course,
- ar.assessment_plan, ar.grading_scale, ar.assessment_group, ar.student_group,
- ard.assessment_criteria, ard.maximum_score, ard.grade, ard.score
- FROM
- `tabAssessment Result` ar, `tabAssessment Result Detail` ard
- WHERE
- ar.name=ard.parent and ar.docstatus=1 and ar.academic_year=%s {0} {1} {2} {3} {4}
- ORDER BY
- ard.assessment_criteria""".format(
- cond, cond1, cond2, cond3, cond4
- ),
- tuple(args_list),
- as_dict=1,
- )
-
- # create the nested dictionary structure as given below:
- #
.....
- # "Final Grade" -> assessment criteria used for totaling and args.assessment_group -> for totaling all the assesments
-
- student_details = {}
- formatted_assessment_result = defaultdict(dict)
- assessment_criteria_dict = OrderedDict()
- course_dict = OrderedDict()
- total_maximum_score = None
- if not (len(assessment_groups) == 1 and assessment_groups[0] == args.assessment_group):
- create_total_dict = True
-
- # add the score for a given score and recalculate the grades
- def add_score_and_recalculate_grade(result, assessment_group, assessment_criteria):
- formatted_assessment_result[result.student][result.course][assessment_group][
- assessment_criteria
- ]["maximum_score"] += result.maximum_score
- formatted_assessment_result[result.student][result.course][assessment_group][
- assessment_criteria
- ]["score"] += result.score
- tmp_grade = get_grade(
- result.grading_scale,
- (
- (
- formatted_assessment_result[result.student][result.course][assessment_group][
- assessment_criteria
- ]["score"]
- )
- / (
- formatted_assessment_result[result.student][result.course][assessment_group][
- assessment_criteria
- ]["maximum_score"]
- )
- )
- * 100,
- )
- formatted_assessment_result[result.student][result.course][assessment_group][
- assessment_criteria
- ]["grade"] = tmp_grade
-
- # create the assessment criteria "Final Grade" with the sum of all the scores of the assessment criteria in a given assessment group
- def add_total_score(result, assessment_group):
- if (
- "Final Grade"
- not in formatted_assessment_result[result.student][result.course][assessment_group]
- ):
- formatted_assessment_result[result.student][result.course][assessment_group][
- "Final Grade"
- ] = frappe._dict(
- {
- "assessment_criteria": "Final Grade",
- "maximum_score": result.maximum_score,
- "score": result.score,
- "grade": result.grade,
- }
- )
- else:
- add_score_and_recalculate_grade(result, assessment_group, "Final Grade")
-
- for result in assessment_result:
- if result.student not in student_details:
- student_details[result.student] = result.student_name
-
- assessment_criteria_details = frappe._dict(
- {
- "assessment_criteria": result.assessment_criteria,
- "maximum_score": result.maximum_score,
- "score": result.score,
- "grade": result.grade,
- }
- )
-
- if not formatted_assessment_result[result.student]:
- formatted_assessment_result[result.student] = defaultdict(dict)
- if not formatted_assessment_result[result.student][result.course]:
- formatted_assessment_result[result.student][result.course] = defaultdict(dict)
-
- if not create_total_dict:
- formatted_assessment_result[result.student][result.course][result.assessment_group][
- result.assessment_criteria
- ] = assessment_criteria_details
- add_total_score(result, result.assessment_group)
-
- # create the total of all the assessment groups criteria-wise
- elif create_total_dict:
- if get_all_assessment_groups:
- formatted_assessment_result[result.student][result.course][result.assessment_group][
- result.assessment_criteria
- ] = assessment_criteria_details
- if not formatted_assessment_result[result.student][result.course][args.assessment_group]:
- formatted_assessment_result[result.student][result.course][
- args.assessment_group
- ] = defaultdict(dict)
- formatted_assessment_result[result.student][result.course][args.assessment_group][
- result.assessment_criteria
- ] = assessment_criteria_details
- elif (
- result.assessment_criteria
- not in formatted_assessment_result[result.student][result.course][args.assessment_group]
- ):
- formatted_assessment_result[result.student][result.course][args.assessment_group][
- result.assessment_criteria
- ] = assessment_criteria_details
- elif (
- result.assessment_criteria
- in formatted_assessment_result[result.student][result.course][args.assessment_group]
- ):
- add_score_and_recalculate_grade(result, args.assessment_group, result.assessment_criteria)
-
- add_total_score(result, args.assessment_group)
-
- total_maximum_score = formatted_assessment_result[result.student][result.course][
- args.assessment_group
- ]["Final Grade"]["maximum_score"]
- if get_assessment_criteria:
- assessment_criteria_dict[result.assessment_criteria] = formatted_assessment_result[
- result.student
- ][result.course][args.assessment_group][result.assessment_criteria]["maximum_score"]
- if get_course:
- course_dict[result.course] = total_maximum_score
-
- if get_assessment_criteria and total_maximum_score:
- assessment_criteria_dict["Final Grade"] = total_maximum_score
-
- return {
- "student_details": student_details,
- "assessment_result": formatted_assessment_result,
- "assessment_criteria": assessment_criteria_dict,
- "course_dict": course_dict,
- }
-
-
-def get_column(assessment_criteria):
- columns = [
- {
- "fieldname": "student",
- "label": _("Student ID"),
- "fieldtype": "Link",
- "options": "Student",
- "width": 90,
- },
- {"fieldname": "student_name", "label": _("Student Name"), "fieldtype": "Data", "width": 160},
- ]
- for d in assessment_criteria:
- columns.append({"fieldname": frappe.scrub(d), "label": d, "fieldtype": "Data", "width": 110})
- columns.append(
- {
- "fieldname": frappe.scrub(d) + "_score",
- "label": "Score(" + str(int(assessment_criteria[d])) + ")",
- "fieldtype": "Float",
- "width": 100,
- }
- )
-
- return columns
-
-
-def get_chart_data(grades, criteria_list, kounter):
- grades = sorted(grades)
- datasets = []
-
- for grade in grades:
- tmp = frappe._dict({"name": grade, "values": []})
- for criteria in criteria_list:
- if grade in kounter[criteria]:
- tmp["values"].append(kounter[criteria][grade])
- else:
- tmp["values"].append(0)
- datasets.append(tmp)
-
- return {
- "data": {"labels": criteria_list, "datasets": datasets},
- "type": "bar",
- }
-
-
-def get_child_assessment_groups(assessment_group):
- assessment_groups = []
- group_type = frappe.get_value("Assessment Group", assessment_group, "is_group")
- if group_type:
- from frappe.desk.treeview import get_children
-
- assessment_groups = [
- d.get("value")
- for d in get_children("Assessment Group", assessment_group)
- if d.get("value") and not d.get("expandable")
- ]
- else:
- assessment_groups = [assessment_group]
- return assessment_groups
diff --git a/erpnext/education/report/final_assessment_grades/__init__.py b/erpnext/education/report/final_assessment_grades/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/final_assessment_grades/final_assessment_grades.js b/erpnext/education/report/final_assessment_grades/final_assessment_grades.js
deleted file mode 100644
index ddff8a884e30..000000000000
--- a/erpnext/education/report/final_assessment_grades/final_assessment_grades.js
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-/* eslint-disable */
-
-frappe.query_reports["Final Assessment Grades"] = {
- "filters": [
- {
- "fieldname":"academic_year",
- "label": __("Academic Year"),
- "fieldtype": "Link",
- "options": "Academic Year",
- "reqd": 1
- },
- {
- "fieldname":"student_group",
- "label": __("Student Group"),
- "fieldtype": "Link",
- "options": "Student Group",
- "reqd": 1,
- "get_query": function() {
- return{
- filters: {
- "group_based_on": "Batch",
- "academic_year": frappe.query_report.get_filter_value('academic_year')
- }
- };
- }
- },
- {
- "fieldname":"assessment_group",
- "label": __("Assessment Group"),
- "fieldtype": "Link",
- "options": "Assessment Group",
- "reqd": 1
- }
-
- ]
-}
diff --git a/erpnext/education/report/final_assessment_grades/final_assessment_grades.json b/erpnext/education/report/final_assessment_grades/final_assessment_grades.json
deleted file mode 100644
index 6a2349476889..000000000000
--- a/erpnext/education/report/final_assessment_grades/final_assessment_grades.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "add_total_row": 0,
- "creation": "2018-01-22 17:04:43.412054",
- "disable_prepared_report": 0,
- "disabled": 0,
- "docstatus": 0,
- "doctype": "Report",
- "idx": 0,
- "is_standard": "Yes",
- "modified": "2020-06-24 17:13:35.373756",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Final Assessment Grades",
- "owner": "Administrator",
- "prepared_report": 0,
- "ref_doctype": "Assessment Result",
- "report_name": "Final Assessment Grades",
- "report_type": "Script Report",
- "roles": [
- {
- "role": "Instructor"
- },
- {
- "role": "Education Manager"
- }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/education/report/final_assessment_grades/final_assessment_grades.py b/erpnext/education/report/final_assessment_grades/final_assessment_grades.py
deleted file mode 100644
index 8d5acc61f2f8..000000000000
--- a/erpnext/education/report/final_assessment_grades/final_assessment_grades.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-from collections import defaultdict
-
-import frappe
-from frappe import _
-
-from erpnext.education.report.course_wise_assessment_report.course_wise_assessment_report import (
- get_chart_data,
- get_formatted_result,
-)
-
-
-def execute(filters=None):
- columns, data, grades = [], [], []
- args = frappe._dict()
- course_wise_analysis = defaultdict(dict)
-
- args["academic_year"] = filters.get("academic_year")
- assessment_group = args["assessment_group"] = filters.get("assessment_group")
-
- student_group = filters.get("student_group")
- args.students = frappe.db.sql_list(
- "select student from `tabStudent Group Student` where parent=%s", (student_group)
- )
-
- values = get_formatted_result(args, get_course=True)
- student_details = values.get("student_details")
- assessment_result = values.get("assessment_result")
- course_dict = values.get("course_dict")
-
- for student in args.students:
- if student_details.get(student):
- student_row = {}
- student_row["student"] = student
- student_row["student_name"] = student_details[student]
- for course in course_dict:
- scrub_course = frappe.scrub(course)
- if assessment_group in assessment_result[student][course]:
- student_row["grade_" + scrub_course] = assessment_result[student][course][assessment_group][
- "Total Score"
- ]["grade"]
- student_row["score_" + scrub_course] = assessment_result[student][course][assessment_group][
- "Total Score"
- ]["score"]
-
- # create the list of possible grades
- if student_row["grade_" + scrub_course] not in grades:
- grades.append(student_row["grade_" + scrub_course])
-
- # create the dict of for gradewise analysis
- if student_row["grade_" + scrub_course] not in course_wise_analysis[course]:
- course_wise_analysis[course][student_row["grade_" + scrub_course]] = 1
- else:
- course_wise_analysis[course][student_row["grade_" + scrub_course]] += 1
-
- data.append(student_row)
-
- course_list = [d for d in course_dict]
- columns = get_column(course_dict)
- chart = get_chart_data(grades, course_list, course_wise_analysis)
- return columns, data, None, chart
-
-
-def get_column(course_dict):
- columns = [
- {
- "fieldname": "student",
- "label": _("Student ID"),
- "fieldtype": "Link",
- "options": "Student",
- "width": 90,
- },
- {"fieldname": "student_name", "label": _("Student Name"), "fieldtype": "Data", "width": 160},
- ]
- for course in course_dict:
- columns.append(
- {
- "fieldname": "grade_" + frappe.scrub(course),
- "label": course,
- "fieldtype": "Data",
- "width": 110,
- }
- )
- columns.append(
- {
- "fieldname": "score_" + frappe.scrub(course),
- "label": "Score(" + str(course_dict[course]) + ")",
- "fieldtype": "Float",
- "width": 100,
- }
- )
-
- return columns
diff --git a/erpnext/education/report/program_wise_fee_collection/__init__.py b/erpnext/education/report/program_wise_fee_collection/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.js b/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.js
deleted file mode 100644
index 72e8f12e9d51..000000000000
--- a/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-/* eslint-disable */
-
-frappe.query_reports["Program wise Fee Collection"] = {
- "filters": [
- {
- "fieldname": "from_date",
- "label": __("From Date"),
- "fieldtype": "Date",
- "default": frappe.datetime.add_months(frappe.datetime.get_today(), -1),
- "reqd": 1
- },
- {
- "fieldname": "to_date",
- "label": __("To Date"),
- "fieldtype": "Date",
- "default": frappe.datetime.get_today(),
- "reqd": 1
- }
- ]
-};
diff --git a/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.json b/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.json
deleted file mode 100644
index ee5c0dec79de..000000000000
--- a/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.json
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "add_total_row": 1,
- "creation": "2020-07-27 16:05:33.263539",
- "disable_prepared_report": 0,
- "disabled": 0,
- "docstatus": 0,
- "doctype": "Report",
- "idx": 0,
- "is_standard": "Yes",
- "json": "{}",
- "modified": "2020-08-05 14:14:12.410515",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Program wise Fee Collection",
- "owner": "Administrator",
- "prepared_report": 0,
- "query": "SELECT \n FeesCollected.program AS \"Program:Link/Program:200\",\n FeesCollected.paid_amount AS \"Fees Collected:Currency:150\",\n FeesCollected.outstanding_amount AS \"Outstanding Amount:Currency:150\",\n FeesCollected.grand_total \"Grand Total:Currency:150\"\nFROM (\n SELECT \n sum(grand_total) - sum(outstanding_amount) AS paid_amount, program,\n sum(outstanding_amount) AS outstanding_amount,\n sum(grand_total) AS grand_total\n FROM `tabFees`\n WHERE docstatus = 1\n GROUP BY program\n) AS FeesCollected\nORDER BY FeesCollected.paid_amount DESC",
- "ref_doctype": "Fees",
- "report_name": "Program wise Fee Collection",
- "report_type": "Script Report",
- "roles": [
- {
- "role": "Academics User"
- },
- {
- "role": "Accounts User"
- },
- {
- "role": "Accounts Manager"
- }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.py b/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.py
deleted file mode 100644
index e5591f9b6be0..000000000000
--- a/erpnext/education/report/program_wise_fee_collection/program_wise_fee_collection.py
+++ /dev/null
@@ -1,122 +0,0 @@
-# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-import frappe
-from frappe import _
-
-
-def execute(filters=None):
- if not filters:
- filters = {}
-
- columns = get_columns(filters)
- data = get_data(filters)
- chart = get_chart_data(data)
-
- return columns, data, None, chart
-
-
-def get_columns(filters=None):
- return [
- {
- "label": _("Program"),
- "fieldname": "program",
- "fieldtype": "Link",
- "options": "Program",
- "width": 300,
- },
- {
- "label": _("Fees Collected"),
- "fieldname": "fees_collected",
- "fieldtype": "Currency",
- "width": 200,
- },
- {
- "label": _("Outstanding Amount"),
- "fieldname": "outstanding_amount",
- "fieldtype": "Currency",
- "width": 200,
- },
- {"label": _("Grand Total"), "fieldname": "grand_total", "fieldtype": "Currency", "width": 200},
- ]
-
-
-def get_data(filters=None):
- data = []
-
- conditions = get_filter_conditions(filters)
-
- fee_details = frappe.db.sql(
- """
- SELECT
- FeesCollected.program,
- FeesCollected.paid_amount,
- FeesCollected.outstanding_amount,
- FeesCollected.grand_total
- FROM (
- SELECT
- sum(grand_total) - sum(outstanding_amount) AS paid_amount, program,
- sum(outstanding_amount) AS outstanding_amount,
- sum(grand_total) AS grand_total
- FROM `tabFees`
- WHERE
- docstatus = 1 and
- program IS NOT NULL
- %s
- GROUP BY program
- ) AS FeesCollected
- ORDER BY FeesCollected.paid_amount DESC
- """
- % (conditions),
- as_dict=1,
- )
-
- for entry in fee_details:
- data.append(
- {
- "program": entry.program,
- "fees_collected": entry.paid_amount,
- "outstanding_amount": entry.outstanding_amount,
- "grand_total": entry.grand_total,
- }
- )
-
- return data
-
-
-def get_filter_conditions(filters):
- conditions = ""
-
- if filters.get("from_date") and filters.get("to_date"):
- conditions += " and posting_date BETWEEN '%s' and '%s'" % (
- filters.get("from_date"),
- filters.get("to_date"),
- )
-
- return conditions
-
-
-def get_chart_data(data):
- if not data:
- return
-
- labels = []
- fees_collected = []
- outstanding_amount = []
-
- for entry in data:
- labels.append(entry.get("program"))
- fees_collected.append(entry.get("fees_collected"))
- outstanding_amount.append(entry.get("outstanding_amount"))
-
- return {
- "data": {
- "labels": labels,
- "datasets": [
- {"name": _("Fees Collected"), "values": fees_collected},
- {"name": _("Outstanding Amt"), "values": outstanding_amount},
- ],
- },
- "type": "bar",
- }
diff --git a/erpnext/education/report/student_and_guardian_contact_details/__init__.py b/erpnext/education/report/student_and_guardian_contact_details/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.js b/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.js
deleted file mode 100644
index 2734b538b2e6..000000000000
--- a/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.js
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.query_reports["Student and Guardian Contact Details"] = {
- "filters": [
- {
- "fieldname":"academic_year",
- "label": __("Academic Year"),
- "fieldtype": "Link",
- "options": "Academic Year",
- "reqd": 1,
- },
- {
- "fieldname":"program",
- "label": __("Program"),
- "fieldtype": "Link",
- "options": "Program",
- "reqd": 1
- },
- {
- "fieldname":"student_batch_name",
- "label": __("Batch Name"),
- "fieldtype": "Link",
- "options": "Student Batch Name",
- "reqd": 1
- },
-
- ]
-}
diff --git a/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.json b/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.json
deleted file mode 100644
index fa9be656810e..000000000000
--- a/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "add_total_row": 0,
- "creation": "2017-03-27 17:47:16.831433",
- "disable_prepared_report": 0,
- "disabled": 0,
- "docstatus": 0,
- "doctype": "Report",
- "idx": 0,
- "is_standard": "Yes",
- "modified": "2020-06-24 17:16:50.639488",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student and Guardian Contact Details",
- "owner": "Administrator",
- "prepared_report": 0,
- "ref_doctype": "Program Enrollment",
- "report_name": "Student and Guardian Contact Details",
- "report_type": "Script Report",
- "roles": [
- {
- "role": "Instructor"
- },
- {
- "role": "Academics User"
- }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py b/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py
deleted file mode 100644
index 6f871d7ad7af..000000000000
--- a/erpnext/education/report/student_and_guardian_contact_details/student_and_guardian_contact_details.py
+++ /dev/null
@@ -1,151 +0,0 @@
-# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-import frappe
-from frappe import _
-
-
-def execute(filters=None):
- columns, data = [], []
-
- academic_year = filters.get("academic_year")
- program = filters.get("program")
- student_batch_name = filters.get("student_batch_name")
-
- columns = get_columns()
-
- program_enrollments = frappe.get_list(
- "Program Enrollment",
- fields=["student", "student_name"],
- filters={
- "academic_year": academic_year,
- "program": program,
- "student_batch_name": student_batch_name,
- },
- )
-
- student_list = [d.student for d in program_enrollments]
- if not student_list:
- return columns, []
-
- group_roll_no_map = get_student_roll_no(academic_year, program, student_batch_name)
- student_map = get_student_details(student_list)
- guardian_map = get_guardian_map(student_list)
-
- for d in program_enrollments:
- student_details = student_map.get(d.student)
- row = [
- group_roll_no_map.get(d.student),
- d.student,
- d.student_name,
- student_details.get("student_mobile_number"),
- student_details.get("student_email_id"),
- student_details.get("address"),
- ]
-
- student_guardians = guardian_map.get(d.student)
-
- if student_guardians:
- for i in range(2):
- if i < len(student_guardians):
- g = student_guardians[i]
- row += [g.guardian_name, g.relation, g.mobile_number, g.email_address]
-
- data.append(row)
-
- return columns, data
-
-
-def get_columns():
- columns = [
- _("Group Roll No") + "::60",
- _("Student ID") + ":Link/Student:90",
- _("Student Name") + "::150",
- _("Student Mobile No.") + "::110",
- _("Student Email ID") + "::125",
- _("Student Address") + "::175",
- _("Guardian1 Name") + "::150",
- _("Relation with Guardian1") + "::80",
- _("Guardian1 Mobile No") + "::125",
- _("Guardian1 Email ID") + "::125",
- _("Guardian2 Name") + "::150",
- _("Relation with Guardian2") + "::80",
- _("Guardian2 Mobile No") + "::125",
- _("Guardian2 Email ID") + "::125",
- ]
- return columns
-
-
-def get_student_details(student_list):
- student_map = frappe._dict()
- student_details = frappe.db.sql(
- """
- select name, student_mobile_number, student_email_id, address_line_1, address_line_2, city, state from `tabStudent` where name in (%s)"""
- % ", ".join(["%s"] * len(student_list)),
- tuple(student_list),
- as_dict=1,
- )
- for s in student_details:
- student = frappe._dict()
- student["student_mobile_number"] = s.student_mobile_number
- student["student_email_id"] = s.student_email_id
- student["address"] = ", ".join(
- [d for d in [s.address_line_1, s.address_line_2, s.city, s.state] if d]
- )
- student_map[s.name] = student
- return student_map
-
-
-def get_guardian_map(student_list):
- guardian_map = frappe._dict()
- guardian_details = frappe.db.sql(
- """
- select parent, guardian, guardian_name, relation from `tabStudent Guardian` where parent in (%s)"""
- % ", ".join(["%s"] * len(student_list)),
- tuple(student_list),
- as_dict=1,
- )
-
- guardian_list = list(set([g.guardian for g in guardian_details])) or [""]
-
- guardian_mobile_no = dict(
- frappe.db.sql(
- """select name, mobile_number from `tabGuardian`
- where name in (%s)"""
- % ", ".join(["%s"] * len(guardian_list)),
- tuple(guardian_list),
- )
- )
-
- guardian_email_id = dict(
- frappe.db.sql(
- """select name, email_address from `tabGuardian`
- where name in (%s)"""
- % ", ".join(["%s"] * len(guardian_list)),
- tuple(guardian_list),
- )
- )
-
- for guardian in guardian_details:
- guardian["mobile_number"] = guardian_mobile_no.get(guardian.guardian)
- guardian["email_address"] = guardian_email_id.get(guardian.guardian)
- guardian_map.setdefault(guardian.parent, []).append(guardian)
-
- return guardian_map
-
-
-def get_student_roll_no(academic_year, program, batch):
- student_group = frappe.get_all(
- "Student Group",
- filters={"academic_year": academic_year, "program": program, "batch": batch, "disabled": 0},
- )
- if student_group:
- roll_no_dict = dict(
- frappe.db.sql(
- """select student, group_roll_number from `tabStudent Group Student` where parent=%s""",
- (student_group[0].name),
- )
- )
- return roll_no_dict
- return {}
diff --git a/erpnext/education/report/student_batch_wise_attendance/__init__.py b/erpnext/education/report/student_batch_wise_attendance/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.js b/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.js
deleted file mode 100644
index 9f1fcbc8162a..000000000000
--- a/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.js
+++ /dev/null
@@ -1,12 +0,0 @@
-// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
-// For license information, please see license.txt
-
-frappe.query_reports["Student Batch-Wise Attendance"] = {
- "filters": [{
- "fieldname": "date",
- "label": __("Date"),
- "fieldtype": "Date",
- "default": frappe.datetime.get_today(),
- "reqd": 1
- }]
-}
diff --git a/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.json b/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.json
deleted file mode 100644
index 8baf8f9fe0e5..000000000000
--- a/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "add_total_row": 0,
- "creation": "2016-11-28 22:07:03.859124",
- "disable_prepared_report": 0,
- "disabled": 0,
- "docstatus": 0,
- "doctype": "Report",
- "idx": 2,
- "is_standard": "Yes",
- "modified": "2020-06-24 17:16:59.823709",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Batch-Wise Attendance",
- "owner": "Administrator",
- "prepared_report": 0,
- "ref_doctype": "Student Attendance",
- "report_name": "Student Batch-Wise Attendance",
- "report_type": "Script Report",
- "roles": [
- {
- "role": "Academics User"
- }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py b/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py
deleted file mode 100644
index 282f5c9aec4b..000000000000
--- a/erpnext/education/report/student_batch_wise_attendance/student_batch_wise_attendance.py
+++ /dev/null
@@ -1,91 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-
-import frappe
-from frappe import _, msgprint
-from frappe.utils import formatdate
-
-from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list
-from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday
-
-
-def execute(filters=None):
- if not filters:
- filters = {}
-
- if not filters.get("date"):
- msgprint(_("Please select date"), raise_exception=1)
-
- holiday_list = get_holiday_list()
- if is_holiday(holiday_list, filters.get("date")):
- msgprint(
- _("No attendance has been marked for {0} as it is a Holiday").format(
- frappe.bold(formatdate(filters.get("date")))
- )
- )
-
- columns = get_columns(filters)
-
- active_student_group = get_active_student_group()
-
- data = []
- for student_group in active_student_group:
- row = [student_group.name]
- present_students = 0
- absent_students = 0
- student_group_strength = get_student_group_strength(student_group.name)
- student_attendance = get_student_attendance(student_group.name, filters.get("date"))
- if student_attendance:
- for attendance in student_attendance:
- if attendance.status == "Present":
- present_students = attendance.count
- elif attendance.status == "Absent":
- absent_students = attendance.count
-
- unmarked_students = student_group_strength - (present_students + absent_students)
- row += [student_group_strength, present_students, absent_students, unmarked_students]
- data.append(row)
-
- return columns, data
-
-
-def get_columns(filters):
- columns = [
- _("Student Group") + ":Link/Student Group:250",
- _("Student Group Strength") + "::170",
- _("Present") + "::90",
- _("Absent") + "::90",
- _("Not Marked") + "::90",
- ]
- return columns
-
-
-def get_active_student_group():
- active_student_groups = frappe.db.sql(
- """select name from `tabStudent Group` where group_based_on = "Batch"
- and academic_year=%s order by name""",
- (frappe.defaults.get_defaults().academic_year),
- as_dict=1,
- )
- return active_student_groups
-
-
-def get_student_group_strength(student_group):
- student_group_strength = frappe.db.sql(
- """select count(*) from `tabStudent Group Student`
- where parent = %s and active=1""",
- student_group,
- )[0][0]
- return student_group_strength
-
-
-def get_student_attendance(student_group, date):
- student_attendance = frappe.db.sql(
- """select count(*) as count, status from `tabStudent Attendance` where
- student_group= %s and date= %s and docstatus = 1 and
- (course_schedule is Null or course_schedule='') group by status""",
- (student_group, date),
- as_dict=1,
- )
- return student_attendance
diff --git a/erpnext/education/report/student_fee_collection/__init__.py b/erpnext/education/report/student_fee_collection/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/student_fee_collection/student_fee_collection.json b/erpnext/education/report/student_fee_collection/student_fee_collection.json
deleted file mode 100644
index c0229a2ee267..000000000000
--- a/erpnext/education/report/student_fee_collection/student_fee_collection.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "add_total_row": 1,
- "creation": "2016-06-22 02:58:41.024538",
- "disable_prepared_report": 0,
- "disabled": 0,
- "docstatus": 0,
- "doctype": "Report",
- "idx": 3,
- "is_standard": "Yes",
- "modified": "2020-06-24 17:14:39.452551",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Fee Collection",
- "owner": "Administrator",
- "prepared_report": 0,
- "query": "SELECT\n student as \"Student:Link/Student:200\",\n student_name as \"Student Name::200\",\n sum(grand_total) - sum(outstanding_amount) as \"Paid Amount:Currency:150\",\n sum(outstanding_amount) as \"Outstanding Amount:Currency:150\",\n sum(grand_total) as \"Grand Total:Currency:150\"\nFROM\n `tabFees` \nWHERE\n docstatus=1 \nGROUP BY\n student",
- "ref_doctype": "Fees",
- "report_name": "Student Fee Collection",
- "report_type": "Query Report",
- "roles": [
- {
- "role": "Academics User"
- }
- ]
-}
diff --git a/erpnext/education/report/student_monthly_attendance_sheet/__init__.py b/erpnext/education/report/student_monthly_attendance_sheet/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
deleted file mode 100644
index 62c94557d7e8..000000000000
--- a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.js
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-// License: GNU General Public License v3. See license.txt
-
-
-frappe.query_reports["Student Monthly Attendance Sheet"] = {
- "filters": [{
- "fieldname": "month",
- "label": __("Month"),
- "fieldtype": "Select",
- "options": "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug\nSep\nOct\nNov\nDec",
- "default": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov",
- "Dec"
- ][frappe.datetime.str_to_obj(frappe.datetime.get_today()).getMonth()],
- },
- {
- "fieldname": "year",
- "label": __("Year"),
- "fieldtype": "Select",
- "reqd": 1
- },
- {
- "fieldname": "student_group",
- "label": __("Student Group"),
- "fieldtype": "Link",
- "options": "Student Group",
- "reqd": 1
- }
- ],
-
- "onload": function() {
- return frappe.call({
- method: "erpnext.education.report.student_monthly_attendance_sheet.student_monthly_attendance_sheet.get_attendance_years",
- callback: function(r) {
- var year_filter = frappe.query_report.get_filter('year');
- year_filter.df.options = r.message;
- year_filter.df.default = r.message.split("\n")[0];
- year_filter.refresh();
- year_filter.set_input(year_filter.df.default);
- }
- });
- }
-}
diff --git a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json
deleted file mode 100644
index 1423d4fee1a1..000000000000
--- a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "add_total_row": 0,
- "creation": "2013-05-13 14:04:03",
- "disable_prepared_report": 0,
- "disabled": 0,
- "docstatus": 0,
- "doctype": "Report",
- "idx": 3,
- "is_standard": "Yes",
- "modified": "2020-06-24 17:16:13.307053",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Student Monthly Attendance Sheet",
- "owner": "Administrator",
- "prepared_report": 0,
- "ref_doctype": "Student Attendance",
- "report_name": "Student Monthly Attendance Sheet",
- "report_type": "Script Report",
- "roles": [
- {
- "role": "Academics User"
- }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py b/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
deleted file mode 100644
index 9312e2b0181e..000000000000
--- a/erpnext/education/report/student_monthly_attendance_sheet/student_monthly_attendance_sheet.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
-# License: GNU General Public License v3. See license.txt
-
-
-import frappe
-from frappe import _
-from frappe.utils import add_days, cstr, date_diff, get_first_day, get_last_day, getdate
-
-from erpnext.education.api import get_student_group_students
-from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list
-from erpnext.support.doctype.issue.issue import get_holidays
-
-
-def execute(filters=None):
- if not filters:
- filters = {}
-
- from_date = get_first_day(filters["month"] + "-" + filters["year"])
- to_date = get_last_day(filters["month"] + "-" + filters["year"])
- total_days_in_month = date_diff(to_date, from_date) + 1
- columns = get_columns(total_days_in_month)
- students = get_student_group_students(filters.get("student_group"), 1)
- students_list = get_students_list(students)
- att_map = get_attendance_list(from_date, to_date, filters.get("student_group"), students_list)
- data = []
-
- for stud in students:
- row = [stud.student, stud.student_name]
- student_status = frappe.db.get_value("Student", stud.student, "enabled")
- date = from_date
- total_p = total_a = 0.0
-
- for day in range(total_days_in_month):
- status = "None"
-
- if att_map.get(stud.student):
- status = att_map.get(stud.student).get(date, "None")
- elif not student_status:
- status = "Inactive"
- else:
- status = "None"
-
- status_map = {"Present": "P", "Absent": "A", "None": "", "Inactive": "-", "Holiday": "H"}
- row.append(status_map[status])
-
- if status == "Present":
- total_p += 1
- elif status == "Absent":
- total_a += 1
- date = add_days(date, 1)
-
- row += [total_p, total_a]
- data.append(row)
- return columns, data
-
-
-def get_columns(days_in_month):
- columns = [_("Student") + ":Link/Student:90", _("Student Name") + "::150"]
- for day in range(days_in_month):
- columns.append(cstr(day + 1) + "::20")
- columns += [_("Total Present") + ":Int:95", _("Total Absent") + ":Int:90"]
- return columns
-
-
-def get_students_list(students):
- student_list = []
- for stud in students:
- student_list.append(stud.student)
- return student_list
-
-
-def get_attendance_list(from_date, to_date, student_group, students_list):
- attendance_list = frappe.db.sql(
- """select student, date, status
- from `tabStudent Attendance` where student_group = %s
- and docstatus = 1
- and date between %s and %s
- order by student, date""",
- (student_group, from_date, to_date),
- as_dict=1,
- )
-
- att_map = {}
- students_with_leave_application = get_students_with_leave_application(
- from_date, to_date, students_list
- )
- for d in attendance_list:
- att_map.setdefault(d.student, frappe._dict()).setdefault(d.date, "")
-
- if students_with_leave_application.get(
- d.date
- ) and d.student in students_with_leave_application.get(d.date):
- att_map[d.student][d.date] = "Present"
- else:
- att_map[d.student][d.date] = d.status
-
- att_map = mark_holidays(att_map, from_date, to_date, students_list)
-
- return att_map
-
-
-def get_students_with_leave_application(from_date, to_date, students_list):
- if not students_list:
- return
- leave_applications = frappe.db.sql(
- """
- select student, from_date, to_date
- from `tabStudent Leave Application`
- where
- mark_as_present = 1 and docstatus = 1
- and student in %(students)s
- and (
- from_date between %(from_date)s and %(to_date)s
- or to_date between %(from_date)s and %(to_date)s
- or (%(from_date)s between from_date and to_date and %(to_date)s between from_date and to_date)
- )
- """,
- {"students": students_list, "from_date": from_date, "to_date": to_date},
- as_dict=True,
- )
- students_with_leaves = {}
- for application in leave_applications:
- for date in daterange(application.from_date, application.to_date):
- students_with_leaves.setdefault(date, []).append(application.student)
-
- return students_with_leaves
-
-
-def daterange(d1, d2):
- import datetime
-
- return (d1 + datetime.timedelta(days=i) for i in range((d2 - d1).days + 1))
-
-
-@frappe.whitelist()
-def get_attendance_years():
- year_list = frappe.db.sql_list(
- """select distinct YEAR(date) from `tabStudent Attendance` ORDER BY YEAR(date) DESC"""
- )
- if not year_list:
- year_list = [getdate().year]
- return "\n".join(str(year) for year in year_list)
-
-
-def mark_holidays(att_map, from_date, to_date, students_list):
- holiday_list = get_holiday_list()
- holidays = get_holidays(holiday_list)
-
- for dt in daterange(getdate(from_date), getdate(to_date)):
- if dt in holidays:
- for student in students_list:
- att_map.setdefault(student, frappe._dict()).setdefault(dt, "Holiday")
-
- return att_map
diff --git a/erpnext/education/setup.py b/erpnext/education/setup.py
deleted file mode 100644
index 2b82da556c3c..000000000000
--- a/erpnext/education/setup.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
-# For license information, please see license.txt
-
-
-import frappe
-
-
-def setup_education():
- disable_desk_access_for_student_role()
- if frappe.db.exists("Academic Year", "2015-16"):
- # already setup
- return
- create_academic_sessions()
-
-
-def insert_record(records):
- for r in records:
- doc = frappe.new_doc(r.get("doctype"))
- doc.update(r)
- try:
- doc.insert(ignore_permissions=True)
- except frappe.DuplicateEntryError as e:
- # pass DuplicateEntryError and continue
- if e.args and e.args[0] == doc.doctype and e.args[1] == doc.name:
- # make sure DuplicateEntryError is for the exact same doc and not a related doc
- pass
- else:
- raise
-
-
-def create_academic_sessions():
- data = [
- {"doctype": "Academic Year", "academic_year_name": "2015-16"},
- {"doctype": "Academic Year", "academic_year_name": "2016-17"},
- {"doctype": "Academic Year", "academic_year_name": "2017-18"},
- {"doctype": "Academic Year", "academic_year_name": "2018-19"},
- {"doctype": "Academic Term", "academic_year": "2016-17", "term_name": "Semester 1"},
- {"doctype": "Academic Term", "academic_year": "2016-17", "term_name": "Semester 2"},
- {"doctype": "Academic Term", "academic_year": "2017-18", "term_name": "Semester 1"},
- {"doctype": "Academic Term", "academic_year": "2017-18", "term_name": "Semester 2"},
- ]
- insert_record(data)
-
-
-def disable_desk_access_for_student_role():
- try:
- student_role = frappe.get_doc("Role", "Student")
- except frappe.DoesNotExistError:
- create_student_role()
- return
-
- student_role.desk_access = 0
- student_role.save()
-
-
-def create_student_role():
- student_role = frappe.get_doc(
- {"doctype": "Role", "role_name": "Student", "desk_access": 0, "restrict_to_domain": "Education"}
- )
- student_role.insert()
diff --git a/erpnext/education/utils.py b/erpnext/education/utils.py
deleted file mode 100644
index e6eb1c998744..000000000000
--- a/erpnext/education/utils.py
+++ /dev/null
@@ -1,449 +0,0 @@
-# Copyright (c) 2015, Frappe Technologies and contributors
-
-import frappe
-from frappe import _
-
-
-class OverlapError(frappe.ValidationError):
- pass
-
-
-def validate_overlap_for(doc, doctype, fieldname, value=None):
- """Checks overlap for specified field.
-
- :param fieldname: Checks Overlap for this field
- """
-
- existing = get_overlap_for(doc, doctype, fieldname, value)
- if existing:
- frappe.throw(
- _("This {0} conflicts with {1} for {2} {3}").format(
- doc.doctype,
- existing.name,
- doc.meta.get_label(fieldname) if not value else fieldname,
- value or doc.get(fieldname),
- ),
- OverlapError,
- )
-
-
-def get_overlap_for(doc, doctype, fieldname, value=None):
- """Returns overlaping document for specified field.
-
- :param fieldname: Checks Overlap for this field
- """
-
- existing = frappe.db.sql(
- """select name, from_time, to_time from `tab{0}`
- where `{1}`=%(val)s and schedule_date = %(schedule_date)s and
- (
- (from_time > %(from_time)s and from_time < %(to_time)s) or
- (to_time > %(from_time)s and to_time < %(to_time)s) or
- (%(from_time)s > from_time and %(from_time)s < to_time) or
- (%(from_time)s = from_time and %(to_time)s = to_time))
- and name!=%(name)s and docstatus!=2""".format(
- doctype, fieldname
- ),
- {
- "schedule_date": doc.schedule_date,
- "val": value or doc.get(fieldname),
- "from_time": doc.from_time,
- "to_time": doc.to_time,
- "name": doc.name or "No Name",
- },
- 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)
-
- return None
-
-
-# LMS Utils
-def get_current_student():
- """Returns current student from frappe.session.user
-
- Returns:
- object: Student Document
- """
- email = frappe.session.user
- if email in ("Administrator", "Guest"):
- return None
- try:
- student_id = frappe.get_all("Student", {"student_email_id": email}, ["name"])[0].name
- return frappe.get_doc("Student", student_id)
- except (IndexError, frappe.DoesNotExistError):
- return None
-
-
-def get_portal_programs():
- """Returns a list of all program to be displayed on the portal
- Programs are returned based on the following logic
- is_published and (student_is_enrolled or student_can_self_enroll)
-
- Returns:
- list of dictionary: List of all programs and to be displayed on the portal along with access rights
- """
- published_programs = frappe.get_all("Program", filters={"is_published": True})
- if not published_programs:
- return None
-
- program_list = [frappe.get_doc("Program", program) for program in published_programs]
- portal_programs = [
- {"program": program, "has_access": allowed_program_access(program.name)}
- for program in program_list
- if allowed_program_access(program.name) or program.allow_self_enroll
- ]
-
- return portal_programs
-
-
-def allowed_program_access(program, student=None):
- """Returns enrollment status for current student
-
- Args:
- program (string): Name of the program
- student (object): instance of Student document
-
- Returns:
- bool: Is current user enrolled or not
- """
- if has_super_access():
- return True
- if not student:
- student = get_current_student()
- if student and get_enrollment("program", program, student.name):
- return True
- else:
- return False
-
-
-def get_enrollment(master, document, student):
- """Gets enrollment for course or program
-
- Args:
- master (string): can either be program or course
- document (string): program or course name
- student (string): Student ID
-
- Returns:
- string: Enrollment Name if exists else returns empty string
- """
- if master == "program":
- enrollments = frappe.get_all(
- "Program Enrollment", filters={"student": student, "program": document, "docstatus": 1}
- )
- if master == "course":
- enrollments = frappe.get_all(
- "Course Enrollment", filters={"student": student, "course": document}
- )
-
- if enrollments:
- return enrollments[0].name
- else:
- return None
-
-
-@frappe.whitelist()
-def enroll_in_program(program_name, student=None):
- """Enroll student in program
-
- Args:
- program_name (string): Name of the program to be enrolled into
- student (string, optional): name of student who has to be enrolled, if not
- provided, a student will be created from the current user
-
- Returns:
- string: name of the program enrollment document
- """
- if has_super_access():
- return
-
- if not student == None:
- student = frappe.get_doc("Student", student)
- else:
- # Check if self enrollment in allowed
- program = frappe.get_doc("Program", program_name)
- if not program.allow_self_enroll:
- return frappe.throw(_("You are not allowed to enroll for this course"))
-
- student = get_current_student()
- if not student:
- student = create_student_from_current_user()
-
- # Check if student is already enrolled in program
- enrollment = get_enrollment("program", program_name, student.name)
- if enrollment:
- return enrollment
-
- # Check if self enrollment in allowed
- program = frappe.get_doc("Program", program_name)
- if not program.allow_self_enroll:
- return frappe.throw(_("You are not allowed to enroll for this course"))
-
- # Enroll in program
- program_enrollment = student.enroll_in_program(program_name)
- return program_enrollment.name
-
-
-def has_super_access():
- """Check if user has a role that allows full access to LMS
-
- Returns:
- bool: true if user has access to all lms content
- """
- current_user = frappe.get_doc("User", frappe.session.user)
- roles = set([role.role for role in current_user.roles])
- return bool(
- roles & {"Administrator", "Instructor", "Education Manager", "System Manager", "Academic User"}
- )
-
-
-@frappe.whitelist()
-def add_activity(course, content_type, content, program):
- if has_super_access():
- return None
-
- student = get_current_student()
- if not student:
- return frappe.throw(
- _("Student with email {0} does not exist").format(frappe.session.user), frappe.DoesNotExistError
- )
-
- enrollment = get_or_create_course_enrollment(course, program)
- if content_type == "Quiz":
- return
- else:
- return enrollment.add_activity(content_type, content)
-
-
-@frappe.whitelist()
-def evaluate_quiz(quiz_response, quiz_name, course, program, time_taken):
- import json
-
- student = get_current_student()
-
- quiz_response = json.loads(quiz_response)
- quiz = frappe.get_doc("Quiz", quiz_name)
- result, score, status = quiz.evaluate(quiz_response, quiz_name)
-
- if has_super_access():
- return {"result": result, "score": score, "status": status}
-
- if student:
- enrollment = get_or_create_course_enrollment(course, program)
- if quiz.allowed_attempt(enrollment, quiz_name):
- enrollment.add_quiz_activity(quiz_name, quiz_response, result, score, status, time_taken)
- return {"result": result, "score": score, "status": status}
- else:
- return None
-
-
-@frappe.whitelist()
-def get_quiz(quiz_name, course):
- try:
- quiz = frappe.get_doc("Quiz", quiz_name)
- questions = quiz.get_questions()
- except Exception:
- frappe.throw(_("Quiz {0} does not exist").format(quiz_name), frappe.DoesNotExistError)
- return None
-
- questions = [
- {
- "name": question.name,
- "question": question.question,
- "type": question.question_type,
- "options": [{"name": option.name, "option": option.option} for option in question.options],
- }
- for question in questions
- ]
-
- if has_super_access():
- return {
- "questions": questions,
- "activity": None,
- "is_time_bound": quiz.is_time_bound,
- "duration": quiz.duration,
- }
-
- student = get_current_student()
- course_enrollment = get_enrollment("course", course, student.name)
- status, score, result, time_taken = check_quiz_completion(quiz, course_enrollment)
- return {
- "questions": questions,
- "activity": {"is_complete": status, "score": score, "result": result, "time_taken": time_taken},
- "is_time_bound": quiz.is_time_bound,
- "duration": quiz.duration,
- }
-
-
-def get_topic_progress(topic, course_name, program):
- """
- Return the porgress of a course in a program as well as the content to continue from.
- :param topic_name:
- :param course_name:
- """
- student = get_current_student()
- if not student:
- return None
- course_enrollment = get_or_create_course_enrollment(course_name, program)
- progress = student.get_topic_progress(course_enrollment.name, topic)
- if not progress:
- return None
- count = sum([activity["is_complete"] for activity in progress])
- if count == 0:
- return {"completed": False, "started": False}
- elif count == len(progress):
- return {"completed": True, "started": True}
- elif count < len(progress):
- return {"completed": False, "started": True}
-
-
-def get_course_progress(course, program):
- """
- Return the porgress of a course in a program as well as the content to continue from.
- :param topic_name:
- :param course_name:
- """
- course_progress = []
- for course_topic in course.topics:
- topic = frappe.get_doc("Topic", course_topic.topic)
- progress = get_topic_progress(topic, course.name, program)
- if progress:
- course_progress.append(progress)
- if course_progress:
- number_of_completed_topics = sum([activity["completed"] for activity in course_progress])
- total_topics = len(course_progress)
- if total_topics == 1:
- return course_progress[0]
- if number_of_completed_topics == 0:
- return {"completed": False, "started": False}
- if number_of_completed_topics == total_topics:
- return {"completed": True, "started": True}
- if number_of_completed_topics < total_topics:
- return {"completed": False, "started": True}
-
- return None
-
-
-def get_program_progress(program):
- program_progress = []
- if not program.courses:
- return None
- for program_course in program.courses:
- course = frappe.get_doc("Course", program_course.course)
- progress = get_course_progress(course, program.name)
- if progress:
- progress["name"] = course.name
- progress["course"] = course.course_name
- program_progress.append(progress)
-
- if program_progress:
- return program_progress
-
- return None
-
-
-def get_program_completion(program):
- topics = frappe.db.sql(
- """select `tabCourse Topic`.topic, `tabCourse Topic`.parent
- from `tabCourse Topic`,
- `tabProgram Course`
- where `tabCourse Topic`.parent = `tabProgram Course`.course
- and `tabProgram Course`.parent = %s""",
- program.name,
- )
-
- progress = []
- for topic in topics:
- topic_doc = frappe.get_doc("Topic", topic[0])
- topic_progress = get_topic_progress(topic_doc, topic[1], program.name)
- if topic_progress:
- progress.append(topic_progress)
-
- if progress:
- number_of_completed_topics = sum([activity["completed"] for activity in progress if activity])
- total_topics = len(progress)
- try:
- return int((float(number_of_completed_topics) / total_topics) * 100)
- except ZeroDivisionError:
- return 0
-
- return 0
-
-
-def create_student_from_current_user():
- user = frappe.get_doc("User", frappe.session.user)
-
- student = frappe.get_doc(
- {
- "doctype": "Student",
- "first_name": user.first_name,
- "last_name": user.last_name,
- "student_email_id": user.email,
- "user": frappe.session.user,
- }
- )
-
- student.save(ignore_permissions=True)
- return student
-
-
-def get_or_create_course_enrollment(course, program):
- student = get_current_student()
- course_enrollment = get_enrollment("course", course, student.name)
- if not course_enrollment:
- program_enrollment = get_enrollment("program", program.name, student.name)
- if not program_enrollment:
- frappe.throw(_("You are not enrolled in program {0}").format(program))
- return
- return student.enroll_in_course(
- course_name=course, program_enrollment=get_enrollment("program", program.name, student.name)
- )
- else:
- return frappe.get_doc("Course Enrollment", course_enrollment)
-
-
-def check_content_completion(content_name, content_type, enrollment_name):
- activity = frappe.get_all(
- "Course Activity",
- filters={"enrollment": enrollment_name, "content_type": content_type, "content": content_name},
- )
- if activity:
- return True
- else:
- return False
-
-
-def check_quiz_completion(quiz, enrollment_name):
- attempts = frappe.get_all(
- "Quiz Activity",
- filters={"enrollment": enrollment_name, "quiz": quiz.name},
- fields=["name", "activity_date", "score", "status", "time_taken"],
- )
- status = False if quiz.max_attempts == 0 else bool(len(attempts) >= quiz.max_attempts)
- score = None
- result = None
- time_taken = None
- if attempts:
- if quiz.grading_basis == "Last Highest Score":
- attempts = sorted(attempts, key=lambda i: int(i.score), reverse=True)
- score = attempts[0]["score"]
- result = attempts[0]["status"]
- time_taken = attempts[0]["time_taken"]
- if result == "Pass":
- status = True
- return status, score, result, time_taken
diff --git a/erpnext/education/web_form/__init__.py b/erpnext/education/web_form/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/web_form/student_applicant/__init__.py b/erpnext/education/web_form/student_applicant/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/education/web_form/student_applicant/student_applicant.js b/erpnext/education/web_form/student_applicant/student_applicant.js
deleted file mode 100644
index ffc5e984253b..000000000000
--- a/erpnext/education/web_form/student_applicant/student_applicant.js
+++ /dev/null
@@ -1,3 +0,0 @@
-frappe.ready(function() {
- // bind events here
-})
diff --git a/erpnext/education/web_form/student_applicant/student_applicant.json b/erpnext/education/web_form/student_applicant/student_applicant.json
deleted file mode 100644
index 7b4eaa18ff9f..000000000000
--- a/erpnext/education/web_form/student_applicant/student_applicant.json
+++ /dev/null
@@ -1,250 +0,0 @@
-{
- "accept_payment": 0,
- "allow_comments": 0,
- "allow_delete": 0,
- "allow_edit": 1,
- "allow_incomplete": 0,
- "allow_multiple": 1,
- "allow_print": 0,
- "amount": 0.0,
- "amount_based_on_field": 0,
- "apply_document_permissions": 0,
- "creation": "2016-09-22 13:10:10.792735",
- "doc_type": "Student Applicant",
- "docstatus": 0,
- "doctype": "Web Form",
- "idx": 0,
- "is_standard": 1,
- "login_required": 1,
- "max_attachment_size": 0,
- "modified": "2020-10-07 23:13:07.814941",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "student-applicant",
- "owner": "Administrator",
- "payment_button_label": "Buy Now",
- "published": 1,
- "route": "student-applicant",
- "route_to_success_link": 0,
- "show_attachments": 0,
- "show_in_grid": 0,
- "show_sidebar": 1,
- "sidebar_items": [],
- "success_url": "/student-applicant",
- "title": "Student Applicant",
- "web_form_fields": [
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "first_name",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "First Name",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 1,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "middle_name",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Middle Name",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "last_name",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Last Name",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 1,
- "fieldname": "program",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Program",
- "max_length": 0,
- "max_value": 0,
- "options": "Program",
- "read_only": 0,
- "reqd": 1,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 1,
- "fieldname": "academic_year",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Academic Year",
- "max_length": 0,
- "max_value": 0,
- "options": "Academic Year",
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 1,
- "fieldname": "academic_term",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Academic Term",
- "max_length": 0,
- "max_value": 0,
- "options": "Academic Term",
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "date_of_birth",
- "fieldtype": "Date",
- "hidden": 0,
- "label": "Date of Birth",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 1,
- "fieldname": "gender",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Gender",
- "max_length": 0,
- "max_value": 0,
- "options": "Gender",
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "blood_group",
- "fieldtype": "Select",
- "hidden": 0,
- "label": "Blood Group",
- "max_length": 0,
- "max_value": 0,
- "options": "\nA+\nA-\nB+\nB-\nO+\nO-\nAB+\nAB-",
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "student_email_id",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Student Email ID",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 1,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "student_mobile_number",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Student Mobile Number",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "default": "",
- "fieldname": "nationality",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Nationality",
- "max_length": 0,
- "max_value": 0,
- "options": "",
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "address_line_1",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Address Line 1",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "address_line_2",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Address Line 2",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "pincode",
- "fieldtype": "Data",
- "hidden": 0,
- "label": "Pincode",
- "max_length": 0,
- "max_value": 0,
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "siblings",
- "fieldtype": "Table",
- "hidden": 0,
- "label": "Siblings",
- "max_length": 0,
- "max_value": 0,
- "options": "Student Sibling",
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- },
- {
- "allow_read_on_all_link_options": 0,
- "fieldname": "student_admission",
- "fieldtype": "Link",
- "hidden": 0,
- "label": "Student Admission",
- "max_length": 0,
- "max_value": 0,
- "options": "Student Admission",
- "read_only": 0,
- "reqd": 0,
- "show_in_filter": 0
- }
- ]
-}
\ No newline at end of file
diff --git a/erpnext/education/web_form/student_applicant/student_applicant.py b/erpnext/education/web_form/student_applicant/student_applicant.py
deleted file mode 100644
index 02e3e933330b..000000000000
--- a/erpnext/education/web_form/student_applicant/student_applicant.py
+++ /dev/null
@@ -1,3 +0,0 @@
-def get_context(context):
- # do your magic here
- pass
diff --git a/erpnext/education/workspace/education/education.json b/erpnext/education/workspace/education/education.json
deleted file mode 100644
index 0c7f19894c31..000000000000
--- a/erpnext/education/workspace/education/education.json
+++ /dev/null
@@ -1,765 +0,0 @@
-{
- "charts": [
- {
- "chart_name": "Program Enrollments",
- "label": "Program Enrollments"
- }
- ],
- "content": "[{\"type\":\"onboarding\",\"data\":{\"onboarding_name\":\"Education\",\"col\":12}},{\"type\":\"chart\",\"data\":{\"chart_name\":\"Program Enrollments\",\"col\":12}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"Your Shortcuts \",\"col\":12}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Student\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Instructor\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Program\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Course\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Fees\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Student Monthly Attendance Sheet\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Course Scheduling Tool\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Student Attendance Tool\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"Reports & Masters \",\"col\":12}},{\"type\":\"card\",\"data\":{\"card_name\":\"Student and Instructor\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Masters\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Content Masters\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Settings\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Admission\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Fees\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Schedule\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Attendance\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"LMS Activity\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Assessment\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Assessment Reports\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Tools\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Other Reports\",\"col\":4}}]",
- "creation": "2020-03-02 17:22:57.066401",
- "docstatus": 0,
- "doctype": "Workspace",
- "for_user": "",
- "hide_custom": 0,
- "icon": "education",
- "idx": 0,
- "label": "Education",
- "links": [
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student and Instructor",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student",
- "link_count": 0,
- "link_to": "Student",
- "link_type": "DocType",
- "onboard": 1,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Instructor",
- "link_count": 0,
- "link_to": "Instructor",
- "link_type": "DocType",
- "onboard": 1,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Guardian",
- "link_count": 0,
- "link_to": "Guardian",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Group",
- "link_count": 0,
- "link_to": "Student Group",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Log",
- "link_count": 0,
- "link_to": "Student Log",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Masters",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Program",
- "link_count": 0,
- "link_to": "Program",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Course",
- "link_count": 0,
- "link_to": "Course",
- "link_type": "DocType",
- "onboard": 1,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Topic",
- "link_count": 0,
- "link_to": "Topic",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Room",
- "link_count": 0,
- "link_to": "Room",
- "link_type": "DocType",
- "onboard": 1,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Content Masters",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Article",
- "link_count": 0,
- "link_to": "Article",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Video",
- "link_count": 0,
- "link_to": "Video",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Quiz",
- "link_count": 0,
- "link_to": "Quiz",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Settings",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Education Settings",
- "link_count": 0,
- "link_to": "Education Settings",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Category",
- "link_count": 0,
- "link_to": "Student Category",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Batch Name",
- "link_count": 0,
- "link_to": "Student Batch Name",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Grading Scale",
- "link_count": 0,
- "link_to": "Grading Scale",
- "link_type": "DocType",
- "onboard": 1,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Academic Term",
- "link_count": 0,
- "link_to": "Academic Term",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Academic Year",
- "link_count": 0,
- "link_to": "Academic Year",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Admission",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Applicant",
- "link_count": 0,
- "link_to": "Student Applicant",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Admission",
- "link_count": 0,
- "link_to": "Student Admission",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Program Enrollment",
- "link_count": 0,
- "link_to": "Program Enrollment",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Course Enrollment",
- "link_count": 0,
- "link_to": "Course Enrollment",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Fees",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Fee Structure",
- "link_count": 0,
- "link_to": "Fee Structure",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Fee Category",
- "link_count": 0,
- "link_to": "Fee Category",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Fee Schedule",
- "link_count": 0,
- "link_to": "Fee Schedule",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Fees",
- "link_count": 0,
- "link_to": "Fees",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Fees",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Student Fee Collection Report",
- "link_count": 0,
- "link_to": "Student Fee Collection",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Fees",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Program wise Fee Collection Report",
- "link_count": 0,
- "link_to": "Program wise Fee Collection",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Schedule",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Course Schedule",
- "link_count": 0,
- "link_to": "Course Schedule",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Course Scheduling Tool",
- "link_count": 0,
- "link_to": "Course Scheduling Tool",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Attendance",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Attendance",
- "link_count": 0,
- "link_to": "Student Attendance",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Leave Application",
- "link_count": 0,
- "link_to": "Student Leave Application",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Student Attendance",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Student Monthly Attendance Sheet",
- "link_count": 0,
- "link_to": "Student Monthly Attendance Sheet",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Student Attendance",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Absent Student Report",
- "link_count": 0,
- "link_to": "Absent Student Report",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Student Attendance",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Student Batch-Wise Attendance",
- "link_count": 0,
- "link_to": "Student Batch-Wise Attendance",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "LMS Activity",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Course Enrollment",
- "link_count": 0,
- "link_to": "Course Enrollment",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Course Activity",
- "link_count": 0,
- "link_to": "Course Activity",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Quiz Activity",
- "link_count": 0,
- "link_to": "Quiz Activity",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Assessment",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Assessment Plan",
- "link_count": 0,
- "link_to": "Assessment Plan",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Assessment Group",
- "link_count": 0,
- "link_to": "Assessment Group",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Assessment Result",
- "link_count": 0,
- "link_to": "Assessment Result",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Assessment Criteria",
- "link_count": 0,
- "link_to": "Assessment Criteria",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Assessment Reports",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "Assessment Result",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Course wise Assessment Report",
- "link_count": 0,
- "link_to": "Course wise Assessment Report",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Assessment Result",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Final Assessment Grades",
- "link_count": 0,
- "link_to": "Final Assessment Grades",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "Assessment Plan",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Assessment Plan Status",
- "link_count": 0,
- "link_to": "Assessment Plan Status",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Report Generation Tool",
- "link_count": 0,
- "link_to": "Student Report Generation Tool",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Tools",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Attendance Tool",
- "link_count": 0,
- "link_to": "Student Attendance Tool",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Assessment Result Tool",
- "link_count": 0,
- "link_to": "Assessment Result Tool",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Student Group Creation Tool",
- "link_count": 0,
- "link_to": "Student Group Creation Tool",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Program Enrollment Tool",
- "link_count": 0,
- "link_to": "Program Enrollment Tool",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "dependencies": "",
- "hidden": 0,
- "is_query_report": 0,
- "label": "Course Scheduling Tool",
- "link_count": 0,
- "link_to": "Course Scheduling Tool",
- "link_type": "DocType",
- "onboard": 0,
- "type": "Link"
- },
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Other Reports",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
- {
- "dependencies": "Program Enrollment",
- "hidden": 0,
- "is_query_report": 1,
- "label": "Student and Guardian Contact Details",
- "link_count": 0,
- "link_to": "Student and Guardian Contact Details",
- "link_type": "Report",
- "onboard": 0,
- "type": "Link"
- }
- ],
- "modified": "2022-01-13 17:29:13.676542",
- "modified_by": "Administrator",
- "module": "Education",
- "name": "Education",
- "owner": "Administrator",
- "parent_page": "",
- "public": 1,
- "restrict_to_domain": "Education",
- "roles": [],
- "sequence_id": 9.0,
- "shortcuts": [
- {
- "color": "Grey",
- "format": "{} Active",
- "label": "Student",
- "link_to": "Student",
- "stats_filter": "{\n \"enabled\": 1\n}",
- "type": "DocType"
- },
- {
- "color": "Grey",
- "format": "{} Active",
- "label": "Instructor",
- "link_to": "Instructor",
- "stats_filter": "{\n \"status\": \"Active\"\n}",
- "type": "DocType"
- },
- {
- "color": "",
- "format": "",
- "label": "Program",
- "link_to": "Program",
- "stats_filter": "",
- "type": "DocType"
- },
- {
- "label": "Course",
- "link_to": "Course",
- "type": "DocType"
- },
- {
- "color": "Grey",
- "format": "{} Unpaid",
- "label": "Fees",
- "link_to": "Fees",
- "stats_filter": "{\n \"outstanding_amount\": [\"!=\", 0.0]\n}",
- "type": "DocType"
- },
- {
- "label": "Student Monthly Attendance Sheet",
- "link_to": "Student Monthly Attendance Sheet",
- "type": "Report"
- },
- {
- "label": "Course Scheduling Tool",
- "link_to": "Course Scheduling Tool",
- "type": "DocType"
- },
- {
- "label": "Student Attendance Tool",
- "link_to": "Student Attendance Tool",
- "type": "DocType"
- },
- {
- "label": "Dashboard",
- "link_to": "Education",
- "type": "Dashboard"
- }
- ],
- "title": "Education"
-}
\ No newline at end of file
diff --git a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
index 46a4d3c69e48..6d977e022ffe 100644
--- a/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
+++ b/erpnext/erpnext_integrations/connectors/woocommerce_connection.py
@@ -32,7 +32,7 @@ def order(*args, **kwargs):
error_message = (
frappe.get_traceback() + "\n\n Request Data: \n" + json.loads(frappe.request.data).__str__()
)
- frappe.log_error(error_message, "WooCommerce Error")
+ frappe.log_error("WooCommerce Error", error_message)
raise
diff --git a/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.py b/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.py
index e1972ae3d38a..55517e482890 100644
--- a/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.py
+++ b/erpnext/erpnext_integrations/doctype/gocardless_settings/gocardless_settings.py
@@ -107,7 +107,7 @@ def create_payment_request(self, data):
return self.create_charge_on_gocardless()
except Exception:
- frappe.log_error(frappe.get_traceback())
+ frappe.log_error("Gocardless payment reqeust failed")
return {
"redirect_to": frappe.redirect_to_message(
_("Server Error"),
@@ -163,21 +163,15 @@ def create_charge_on_gocardless(self):
or payment.status == "charged_back"
):
self.integration_request.db_set("status", "Cancelled", update_modified=False)
- frappe.log_error(
- _("Payment Cancelled. Please check your GoCardless Account for more details"),
- "GoCardless Payment Error",
- )
+ frappe.log_error("Gocardless payment cancelled")
self.integration_request.db_set("error", payment.status, update_modified=False)
else:
self.integration_request.db_set("status", "Failed", update_modified=False)
- frappe.log_error(
- _("Payment Failed. Please check your GoCardless Account for more details"),
- "GoCardless Payment Error",
- )
+ frappe.log_error("Gocardless payment failed")
self.integration_request.db_set("error", payment.status, update_modified=False)
except Exception as e:
- frappe.log_error(e, "GoCardless Payment Error")
+ frappe.log_error("GoCardless Payment Error")
if self.flags.status_changed_to == "Completed":
status = "Completed"
@@ -188,7 +182,7 @@ def create_charge_on_gocardless(self):
self.data.get("reference_doctype"), self.data.get("reference_docname")
).run_method("on_payment_authorized", self.flags.status_changed_to)
except Exception:
- frappe.log_error(frappe.get_traceback())
+ frappe.log_error("Gocardless redirect failed")
if custom_redirect_to:
redirect_to = custom_redirect_to
diff --git a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py
index 78a598ce9858..e38998072664 100644
--- a/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py
+++ b/erpnext/erpnext_integrations/doctype/mpesa_settings/mpesa_settings.py
@@ -152,7 +152,7 @@ def generate_stk_push(**kwargs):
return response
except Exception:
- frappe.log_error(title=_("Mpesa Express Transaction Error"))
+ frappe.log_error("Mpesa Express Transaction Error")
frappe.throw(
_("Issue detected with Mpesa configuration, check the error logs for more details"),
title=_("Mpesa Express Error"),
@@ -203,7 +203,7 @@ def verify_transaction(**kwargs):
integration_request.handle_success(transaction_response)
except Exception:
integration_request.handle_failure(transaction_response)
- frappe.log_error(frappe.get_traceback())
+ frappe.log_error("Mpesa: Failed to verify transaction")
else:
integration_request.handle_failure(transaction_response)
@@ -275,7 +275,7 @@ def get_account_balance(request_payload):
)
return response
except Exception:
- frappe.log_error(title=_("Account Balance Processing Error"))
+ frappe.log_error("Mpesa: Failed to get account balance")
frappe.throw(_("Please check your configuration and try again"), title=_("Error"))
@@ -315,7 +315,7 @@ def process_balance_info(**kwargs):
except Exception:
request.handle_failure(account_balance_response)
frappe.log_error(
- title=_("Mpesa Account Balance Processing Error"), message=account_balance_response
+ title="Mpesa Account Balance Processing Error", message=account_balance_response
)
else:
request.handle_failure(account_balance_response)
diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_connector.py b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_connector.py
index 625dd3110ea2..38d69932f246 100644
--- a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_connector.py
+++ b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_connector.py
@@ -23,7 +23,7 @@ def __init__(self, access_token=None):
def get_access_token(self, public_token):
if public_token is None:
- frappe.log_error(_("Public token is missing for this bank"), _("Plaid public token error"))
+ frappe.log_error("Plaid: Public token is missing")
response = self.client.Item.public_token.exchange(public_token)
access_token = response["access_token"]
return access_token
@@ -61,10 +61,10 @@ def get_link_token(self, update_mode=False):
try:
response = self.client.LinkToken.create(token_request)
except InvalidRequestError:
- frappe.log_error(frappe.get_traceback(), _("Plaid invalid request error"))
+ frappe.log_error("Plaid: Invalid request error")
frappe.msgprint(_("Please check your Plaid client ID and secret values"))
except APIError as e:
- frappe.log_error(frappe.get_traceback(), _("Plaid authentication error"))
+ frappe.log_error("Plaid: Authentication error")
frappe.throw(_(str(e)), title=_("Authentication Failed"))
else:
return response["link_token"]
@@ -81,7 +81,7 @@ def auth(self):
except requests.Timeout:
pass
except Exception as e:
- frappe.log_error(frappe.get_traceback(), _("Plaid authentication error"))
+ frappe.log_error("Plaid: Authentication error")
frappe.throw(_(str(e)), title=_("Authentication Failed"))
def get_transactions(self, start_date, end_date, account_id=None):
@@ -102,4 +102,4 @@ def get_transactions(self, start_date, end_date, account_id=None):
except ItemError as e:
raise e
except Exception:
- frappe.log_error(frappe.get_traceback(), _("Plaid transactions sync error"))
+ frappe.log_error("Plaid: Transactions sync error")
diff --git a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py
index ce65f6c0ff71..62ea85fc5d21 100644
--- a/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py
+++ b/erpnext/erpnext_integrations/doctype/plaid_settings/plaid_settings.py
@@ -54,7 +54,7 @@ def add_institution(token, response):
)
bank.insert()
except Exception:
- frappe.log_error(frappe.get_traceback(), title=_("Plaid Link Error"))
+ frappe.log_error("Plaid Link Error")
else:
bank = frappe.get_doc("Bank", response["institution"]["name"])
bank.plaid_access_token = access_token
@@ -113,7 +113,7 @@ def add_bank_accounts(response, bank, company):
_("Bank account {0} already exists and could not be created again").format(account["name"])
)
except Exception:
- frappe.log_error(frappe.get_traceback(), title=_("Plaid Link Error"))
+ frappe.log_error("Plaid Link Error")
frappe.throw(
_("There was an error creating Bank Account while linking with Plaid."),
title=_("Plaid Link Failed"),
@@ -135,7 +135,7 @@ def add_bank_accounts(response, bank, company):
existing_account.save()
result.append(existing_bank_account)
except Exception:
- frappe.log_error(frappe.get_traceback(), title=_("Plaid Link Error"))
+ frappe.log_error("Plaid Link Error")
frappe.throw(
_("There was an error updating Bank Account {} while linking with Plaid.").format(
existing_bank_account
diff --git a/erpnext/erpnext_integrations/exotel_integration.py b/erpnext/erpnext_integrations/exotel_integration.py
index 522de9ead838..fd9f74e8c9b7 100644
--- a/erpnext/erpnext_integrations/exotel_integration.py
+++ b/erpnext/erpnext_integrations/exotel_integration.py
@@ -1,6 +1,5 @@
import frappe
import requests
-from frappe import _
# api/method/erpnext.erpnext_integrations.exotel_integration.handle_incoming_call
# api/method/erpnext.erpnext_integrations.exotel_integration.handle_end_call
@@ -26,8 +25,7 @@ def handle_incoming_call(**kwargs):
update_call_log(call_payload, call_log=call_log)
except Exception as e:
frappe.db.rollback()
- frappe.log_error(title=_("Error in Exotel incoming call"))
- frappe.db.commit()
+ exotel_settings.log_error("Error in Exotel incoming call")
@frappe.whitelist(allow_guest=True)
diff --git a/erpnext/erpnext_integrations/stripe_integration.py b/erpnext/erpnext_integrations/stripe_integration.py
index b12adc1d3df4..2d7e8a5d31e7 100644
--- a/erpnext/erpnext_integrations/stripe_integration.py
+++ b/erpnext/erpnext_integrations/stripe_integration.py
@@ -22,7 +22,7 @@ def create_stripe_subscription(gateway_controller, data):
return create_subscription_on_stripe(stripe_settings)
except Exception:
- frappe.log_error(frappe.get_traceback())
+ stripe_settings.log_error("Unable to create Stripe subscription")
return {
"redirect_to": frappe.redirect_to_message(
_("Server Error"),
@@ -55,9 +55,9 @@ def create_subscription_on_stripe(stripe_settings):
else:
stripe_settings.integration_request.db_set("status", "Failed", update_modified=False)
- frappe.log_error("Subscription N°: " + subscription.id, "Stripe Payment not completed")
+ frappe.log_error(f"Stripe Subscription ID {subscription.id}: Payment failed")
except Exception:
stripe_settings.integration_request.db_set("status", "Failed", update_modified=False)
- frappe.log_error(frappe.get_traceback())
+ stripe_settings.log_error("Unable to create Stripe subscription")
return stripe_settings.finalize_request()
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index fe0a89a27690..066249ba22fd 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -62,14 +62,12 @@
"Supplier Group",
"Sales Person",
"Territory",
- "Assessment Group",
"Department",
]
# website
update_website_context = [
"erpnext.e_commerce.shopping_cart.utils.update_website_context",
- "erpnext.education.doctype.education_settings.education_settings.update_website_context",
]
my_account_context = "erpnext.e_commerce.shopping_cart.utils.update_my_account_context"
webform_list_context = "erpnext.controllers.website_list_for_contact.get_webform_list_context"
@@ -80,25 +78,9 @@
"Leave Application",
"Sales Order",
"Holiday List",
- "Course Schedule",
]
-domains = {
- "Distribution": "erpnext.domains.distribution",
- "Education": "erpnext.domains.education",
- "Manufacturing": "erpnext.domains.manufacturing",
- "Retail": "erpnext.domains.retail",
- "Services": "erpnext.domains.services",
-}
-
-website_generators = [
- "Item Group",
- "Website Item",
- "BOM",
- "Sales Partner",
- "Job Opening",
- "Student Admission",
-]
+website_generators = ["Item Group", "Website Item", "BOM", "Sales Partner", "Job Opening"]
website_context = {
"favicon": "/assets/erpnext/images/erpnext-favicon.svg",
@@ -182,7 +164,6 @@
"defaults": {"doctype": "Address", "parents": [{"label": _("Addresses"), "route": "addresses"}]},
},
{"from_route": "/jobs", "to_route": "Job Opening"},
- {"from_route": "/admissions", "to_route": "Student Admission"},
{"from_route": "/boms", "to_route": "BOM"},
{"from_route": "/timesheets", "to_route": "Timesheet"},
{"from_route": "/material-requests", "to_route": "Material Request"},
@@ -255,14 +236,7 @@
"reference_doctype": "Timesheet",
"role": "Customer",
},
- {"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role": "Student"},
{"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"},
- {
- "title": _("Admission"),
- "route": "/admissions",
- "reference_doctype": "Student Admission",
- "role": "Student",
- },
{
"title": _("Material Request"),
"route": "/material-requests",
@@ -275,7 +249,6 @@
default_roles = [
{"role": "Customer", "doctype": "Contact", "email_field": "email_id"},
{"role": "Supplier", "doctype": "Contact", "email_field": "email_id"},
- {"role": "Student", "doctype": "Student", "email_field": "student_email_id"},
]
sounds = [
@@ -539,11 +512,8 @@
"Landed Cost Item",
"Asset Value Adjustment",
"Loyalty Program",
- "Fee Schedule",
- "Fee Structure",
"Stock Reconciliation",
"Travel Request",
- "Fees",
"POS Profile",
"Opening Invoice Creation Tool",
"Opening Invoice Creation Tool Item",
@@ -551,6 +521,9 @@
"Subscription Plan",
"POS Invoice",
"POS Invoice Item",
+ "Purchase Order",
+ "Purchase Receipt",
+ "Sales Order",
]
regional_overrides = {
@@ -646,48 +619,6 @@
{"doctype": "Maintenance Visit", "index": 46},
{"doctype": "Warranty Claim", "index": 47},
],
- "Education": [
- {"doctype": "Article", "index": 1},
- {"doctype": "Video", "index": 2},
- {"doctype": "Topic", "index": 3},
- {"doctype": "Course", "index": 4},
- {"doctype": "Program", "index": 5},
- {"doctype": "Quiz", "index": 6},
- {"doctype": "Question", "index": 7},
- {"doctype": "Fee Schedule", "index": 8},
- {"doctype": "Fee Structure", "index": 9},
- {"doctype": "Fees", "index": 10},
- {"doctype": "Student Group", "index": 11},
- {"doctype": "Student", "index": 12},
- {"doctype": "Instructor", "index": 13},
- {"doctype": "Course Activity", "index": 14},
- {"doctype": "Quiz Activity", "index": 15},
- {"doctype": "Course Enrollment", "index": 16},
- {"doctype": "Program Enrollment", "index": 17},
- {"doctype": "Student Language", "index": 18},
- {"doctype": "Student Applicant", "index": 19},
- {"doctype": "Assessment Result", "index": 20},
- {"doctype": "Assessment Plan", "index": 21},
- {"doctype": "Grading Scale", "index": 22},
- {"doctype": "Guardian", "index": 23},
- {"doctype": "Student Leave Application", "index": 24},
- {"doctype": "Student Log", "index": 25},
- {"doctype": "Room", "index": 26},
- {"doctype": "Course Schedule", "index": 27},
- {"doctype": "Student Attendance", "index": 28},
- {"doctype": "Announcement", "index": 29},
- {"doctype": "Student Category", "index": 30},
- {"doctype": "Assessment Group", "index": 31},
- {"doctype": "Student Batch Name", "index": 32},
- {"doctype": "Assessment Criteria", "index": 33},
- {"doctype": "Academic Year", "index": 34},
- {"doctype": "Academic Term", "index": 35},
- {"doctype": "School House", "index": 36},
- {"doctype": "Student Admission", "index": 37},
- {"doctype": "Fee Category", "index": 38},
- {"doctype": "Assessment Code", "index": 39},
- {"doctype": "Discussion", "index": 40},
- ],
}
additional_timeline_content = {
diff --git a/erpnext/hr/doctype/employee_checkin/employee_checkin.py b/erpnext/hr/doctype/employee_checkin/employee_checkin.py
index 64eb019b0034..e07b5e5db528 100644
--- a/erpnext/hr/doctype/employee_checkin/employee_checkin.py
+++ b/erpnext/hr/doctype/employee_checkin/employee_checkin.py
@@ -5,7 +5,7 @@
import frappe
from frappe import _
from frappe.model.document import Document
-from frappe.utils import cint, get_datetime
+from frappe.utils import cint, get_datetime, get_link_to_form
from erpnext.hr.doctype.attendance.attendance import (
get_duplicate_attendance_record,
@@ -130,14 +130,11 @@ def mark_attendance_and_link_log(
"""
log_names = [x.name for x in logs]
employee = logs[0].employee
+
if attendance_status == "Skip":
- frappe.db.sql(
- """update `tabEmployee Checkin`
- set skip_auto_attendance = %s
- where name in %s""",
- ("1", log_names),
- )
+ skip_attendance_in_checkins(log_names)
return None
+
elif attendance_status in ("Present", "Absent", "Half Day"):
employee_doc = frappe.get_doc("Employee", employee)
duplicate = get_duplicate_attendance_record(employee, attendance_date, shift)
@@ -159,6 +156,12 @@ def mark_attendance_and_link_log(
}
attendance = frappe.get_doc(doc_dict).insert()
attendance.submit()
+
+ if attendance_status == "Absent":
+ attendance.add_comment(
+ text=_("Employee was marked Absent for not meeting the working hours threshold.")
+ )
+
frappe.db.sql(
"""update `tabEmployee Checkin`
set attendance = %s
@@ -167,13 +170,10 @@ def mark_attendance_and_link_log(
)
return attendance
else:
- frappe.db.sql(
- """update `tabEmployee Checkin`
- set skip_auto_attendance = %s
- where name in %s""",
- ("1", log_names),
- )
+ skip_attendance_in_checkins(log_names)
+ add_comment_in_checkins(log_names, duplicate, overlapping)
return None
+
else:
frappe.throw(_("{} is an invalid Attendance Status.").format(attendance_status))
@@ -241,3 +241,34 @@ def time_diff_in_hours(start, end):
def find_index_in_dict(dict_list, key, value):
return next((index for (index, d) in enumerate(dict_list) if d[key] == value), None)
+
+
+def add_comment_in_checkins(log_names, duplicate, overlapping):
+ if duplicate:
+ text = _("Auto Attendance skipped due to duplicate attendance record: {}").format(
+ get_link_to_form("Attendance", duplicate[0].name)
+ )
+ else:
+ text = _("Auto Attendance skipped due to overlapping attendance record: {}").format(
+ get_link_to_form("Attendance", overlapping.name)
+ )
+
+ for name in log_names:
+ frappe.get_doc(
+ {
+ "doctype": "Comment",
+ "comment_type": "Comment",
+ "reference_doctype": "Employee Checkin",
+ "reference_name": name,
+ "content": text,
+ }
+ ).insert(ignore_permissions=True)
+
+
+def skip_attendance_in_checkins(log_names):
+ EmployeeCheckin = frappe.qb.DocType("Employee Checkin")
+ (
+ frappe.qb.update(EmployeeCheckin)
+ .set("skip_auto_attendance", 1)
+ .where(EmployeeCheckin.name.isin(log_names))
+ ).run()
diff --git a/erpnext/hr/doctype/shift_type/shift_type.py b/erpnext/hr/doctype/shift_type/shift_type.py
index 5e214cf7b7aa..a61bb9ee5f13 100644
--- a/erpnext/hr/doctype/shift_type/shift_type.py
+++ b/erpnext/hr/doctype/shift_type/shift_type.py
@@ -134,7 +134,17 @@ def mark_absent_for_dates_with_no_attendance(self, employee):
shift_details = get_employee_shift(employee, timestamp, True)
if shift_details and shift_details.shift_type.name == self.name:
- mark_attendance(employee, date, "Absent", self.name)
+ attendance = mark_attendance(employee, date, "Absent", self.name)
+ if attendance:
+ frappe.get_doc(
+ {
+ "doctype": "Comment",
+ "comment_type": "Comment",
+ "reference_doctype": "Attendance",
+ "reference_name": attendance,
+ "content": frappe._("Employee was marked Absent due to missing Employee Checkins."),
+ }
+ ).insert(ignore_permissions=True)
def get_start_and_end_dates(self, employee):
"""Returns start and end dates for checking attendance and marking absent
diff --git a/erpnext/hr/doctype/training_event/training_event.json b/erpnext/hr/doctype/training_event/training_event.json
index fcf845a5879e..42e02ca3bfb8 100644
--- a/erpnext/hr/doctype/training_event/training_event.json
+++ b/erpnext/hr/doctype/training_event/training_event.json
@@ -1,850 +1,231 @@
{
- "allow_copy": 0,
- "allow_guest_to_view": 0,
- "allow_import": 1,
- "allow_rename": 1,
- "autoname": "field:event_name",
- "beta": 0,
- "creation": "2016-08-08 04:53:58.355206",
- "custom": 0,
- "docstatus": 0,
- "doctype": "DocType",
- "document_type": "",
- "editable_grid": 1,
+ "actions": [],
+ "allow_import": 1,
+ "allow_rename": 1,
+ "autoname": "field:event_name",
+ "creation": "2016-08-08 04:53:58.355206",
+ "doctype": "DocType",
+ "editable_grid": 1,
+ "engine": "InnoDB",
+ "field_order": [
+ "event_name",
+ "training_program",
+ "event_status",
+ "has_certificate",
+ "column_break_2",
+ "type",
+ "level",
+ "company",
+ "section_break_4",
+ "trainer_name",
+ "trainer_email",
+ "column_break_7",
+ "supplier",
+ "contact_number",
+ "section_break_9",
+ "course",
+ "location",
+ "column_break_12",
+ "start_time",
+ "end_time",
+ "section_break_15",
+ "introduction",
+ "section_break_18",
+ "employees",
+ "amended_from",
+ "employee_emails"
+ ],
"fields": [
{
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "event_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 0,
- "label": "Event Name",
- "length": 0,
- "no_copy": 1,
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "training_program",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Training Program",
- "length": 0,
- "no_copy": 0,
- "options": "Training 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_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "event_status",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "Event Status",
- "length": 0,
- "no_copy": 0,
- "options": "Scheduled\nCompleted\nCancelled",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.type == 'Seminar' || doc.type == 'Workshop' || doc.type == 'Conference' || doc.type == 'Exam'",
- "fieldname": "has_certificate",
- "fieldtype": "Check",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Has Certificate",
- "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_bulk_edit": 0,
- "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_global_search": 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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "type",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "Type",
- "length": 0,
- "no_copy": 0,
- "options": "Seminar\nTheory\nWorkshop\nConference\nExam\nInternet\nSelf-Study",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "depends_on": "eval:doc.type == 'Seminar' || doc.type == 'Workshop' || doc.type == 'Exam'",
- "fieldname": "level",
- "fieldtype": "Select",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Level",
- "length": 0,
- "no_copy": 0,
- "options": "\nBeginner\nIntermediate\nAdvance",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "company",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Company",
- "length": 0,
- "no_copy": 0,
- "options": "Company",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_4",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "trainer_name",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Trainer 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": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "trainer_email",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Trainer Email",
- "length": 0,
- "no_copy": 0,
- "options": "",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_7",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "supplier",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Supplier",
- "length": 0,
- "no_copy": 0,
- "options": "Supplier",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "contact_number",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Contact Number",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_9",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "course",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 1,
- "label": "Course",
- "length": 0,
- "no_copy": 0,
- "options": "Course",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "location",
- "fieldtype": "Data",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 1,
- "in_standard_filter": 1,
- "label": "Location",
- "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
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "column_break_12",
- "fieldtype": "Column Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "start_time",
- "fieldtype": "Datetime",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Start Time",
- "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
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "end_time",
- "fieldtype": "Datetime",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "End Time",
- "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
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_15",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "introduction",
- "fieldtype": "Text Editor",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Introduction",
- "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
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "section_break_18",
- "fieldtype": "Section Break",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Attendees",
- "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_bulk_edit": 0,
- "allow_on_submit": 1,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "employees",
- "fieldtype": "Table",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Employees",
- "length": 0,
- "no_copy": 0,
- "options": "Training Event Employee",
- "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_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "amended_from",
- "fieldtype": "Link",
- "hidden": 0,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Amended From",
- "length": 0,
- "no_copy": 1,
- "options": "Training Event",
- "permlevel": 0,
- "print_hide": 1,
- "print_hide_if_no_value": 0,
- "read_only": 1,
- "remember_last_selected_value": 0,
- "report_hide": 0,
- "reqd": 0,
- "search_index": 0,
- "set_only_once": 0,
- "unique": 0
- },
- {
- "allow_bulk_edit": 0,
- "allow_on_submit": 0,
- "bold": 0,
- "collapsible": 0,
- "columns": 0,
- "fieldname": "employee_emails",
- "fieldtype": "Small Text",
- "hidden": 1,
- "ignore_user_permissions": 0,
- "ignore_xss_filter": 0,
- "in_filter": 0,
- "in_global_search": 0,
- "in_list_view": 0,
- "in_standard_filter": 0,
- "label": "Employee Emails",
- "length": 0,
- "no_copy": 0,
- "options": "Email",
- "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
+ "fieldname": "event_name",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "label": "Event Name",
+ "no_copy": 1,
+ "reqd": 1,
+ "unique": 1
+ },
+ {
+ "fieldname": "training_program",
+ "fieldtype": "Link",
+ "label": "Training Program",
+ "options": "Training Program"
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "event_status",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "Event Status",
+ "options": "Scheduled\nCompleted\nCancelled",
+ "reqd": 1
+ },
+ {
+ "default": "0",
+ "depends_on": "eval:doc.type == 'Seminar' || doc.type == 'Workshop' || doc.type == 'Conference' || doc.type == 'Exam'",
+ "fieldname": "has_certificate",
+ "fieldtype": "Check",
+ "label": "Has Certificate"
+ },
+ {
+ "fieldname": "column_break_2",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "type",
+ "fieldtype": "Select",
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "Type",
+ "options": "Seminar\nTheory\nWorkshop\nConference\nExam\nInternet\nSelf-Study",
+ "reqd": 1
+ },
+ {
+ "depends_on": "eval:doc.type == 'Seminar' || doc.type == 'Workshop' || doc.type == 'Exam'",
+ "fieldname": "level",
+ "fieldtype": "Select",
+ "label": "Level",
+ "options": "\nBeginner\nIntermediate\nAdvance"
+ },
+ {
+ "fieldname": "company",
+ "fieldtype": "Link",
+ "label": "Company",
+ "options": "Company"
+ },
+ {
+ "fieldname": "section_break_4",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "trainer_name",
+ "fieldtype": "Data",
+ "label": "Trainer Name"
+ },
+ {
+ "fieldname": "trainer_email",
+ "fieldtype": "Data",
+ "label": "Trainer Email"
+ },
+ {
+ "fieldname": "column_break_7",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "supplier",
+ "fieldtype": "Link",
+ "label": "Supplier",
+ "options": "Supplier"
+ },
+ {
+ "fieldname": "contact_number",
+ "fieldtype": "Data",
+ "label": "Contact Number"
+ },
+ {
+ "fieldname": "section_break_9",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "course",
+ "fieldtype": "Data",
+ "in_standard_filter": 1,
+ "label": "Course"
+ },
+ {
+ "fieldname": "location",
+ "fieldtype": "Data",
+ "in_list_view": 1,
+ "in_standard_filter": 1,
+ "label": "Location",
+ "reqd": 1
+ },
+ {
+ "fieldname": "column_break_12",
+ "fieldtype": "Column Break"
+ },
+ {
+ "fieldname": "start_time",
+ "fieldtype": "Datetime",
+ "label": "Start Time",
+ "reqd": 1
+ },
+ {
+ "fieldname": "end_time",
+ "fieldtype": "Datetime",
+ "label": "End Time",
+ "reqd": 1
+ },
+ {
+ "fieldname": "section_break_15",
+ "fieldtype": "Section Break"
+ },
+ {
+ "fieldname": "introduction",
+ "fieldtype": "Text Editor",
+ "label": "Introduction",
+ "reqd": 1
+ },
+ {
+ "fieldname": "section_break_18",
+ "fieldtype": "Section Break",
+ "label": "Attendees"
+ },
+ {
+ "allow_on_submit": 1,
+ "fieldname": "employees",
+ "fieldtype": "Table",
+ "label": "Employees",
+ "options": "Training Event Employee"
+ },
+ {
+ "fieldname": "amended_from",
+ "fieldtype": "Link",
+ "label": "Amended From",
+ "no_copy": 1,
+ "options": "Training Event",
+ "print_hide": 1,
+ "read_only": 1
+ },
+ {
+ "fieldname": "employee_emails",
+ "fieldtype": "Small Text",
+ "hidden": 1,
+ "label": "Employee Emails",
+ "options": "Email"
}
- ],
- "has_web_view": 0,
- "hide_heading": 0,
- "hide_toolbar": 0,
- "idx": 0,
- "image_view": 0,
- "in_create": 0,
- "is_submittable": 1,
- "issingle": 0,
- "istable": 0,
- "max_attachments": 0,
- "modified": "2019-03-12 10:56:29.065781",
- "modified_by": "Administrator",
- "module": "HR",
- "name": "Training Event",
- "name_case": "",
- "owner": "Administrator",
+ ],
+ "is_submittable": 1,
+ "links": [],
+ "modified": "2022-04-28 13:29:35.139497",
+ "modified_by": "Administrator",
+ "module": "HR",
+ "name": "Training Event",
+ "naming_rule": "By fieldname",
+ "owner": "Administrator",
"permissions": [
{
- "amend": 1,
- "apply_user_permissions": 0,
- "cancel": 1,
- "create": 1,
- "delete": 1,
- "email": 1,
- "export": 1,
- "if_owner": 0,
- "import": 1,
- "permlevel": 0,
- "print": 1,
- "read": 1,
- "report": 1,
- "role": "HR Manager",
- "set_user_permissions": 0,
- "share": 1,
- "submit": 1,
+ "amend": 1,
+ "cancel": 1,
+ "create": 1,
+ "delete": 1,
+ "email": 1,
+ "export": 1,
+ "import": 1,
+ "print": 1,
+ "read": 1,
+ "report": 1,
+ "role": "HR Manager",
+ "share": 1,
+ "submit": 1,
"write": 1
}
- ],
- "quick_entry": 0,
- "read_only": 0,
- "read_only_onload": 0,
- "search_fields": "event_name",
- "show_name_in_global_search": 1,
- "sort_field": "modified",
- "sort_order": "DESC",
- "title_field": "event_name",
- "track_changes": 0,
- "track_seen": 0
-}
+ ],
+ "search_fields": "event_name",
+ "show_name_in_global_search": 1,
+ "sort_field": "modified",
+ "sort_order": "DESC",
+ "states": [],
+ "title_field": "event_name"
+}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/training_feedback/training_feedback.json b/erpnext/hr/doctype/training_feedback/training_feedback.json
index ebf5a506f036..e96891177640 100644
--- a/erpnext/hr/doctype/training_feedback/training_feedback.json
+++ b/erpnext/hr/doctype/training_feedback/training_feedback.json
@@ -1,7 +1,7 @@
{
"actions": [],
"autoname": "HR-TRF-.YYYY.-.#####",
- "creation": "2016-08-08 06:35:34.158568",
+ "creation": "2022-01-27 13:14:35.935580",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
@@ -46,9 +46,8 @@
{
"fetch_from": "training_event.course",
"fieldname": "course",
- "fieldtype": "Link",
+ "fieldtype": "Data",
"label": "Course",
- "options": "Course",
"read_only": 1
},
{
@@ -101,7 +100,7 @@
],
"is_submittable": 1,
"links": [],
- "modified": "2022-01-18 19:32:20.805277",
+ "modified": "2022-04-28 13:32:29.261421",
"modified_by": "Administrator",
"module": "HR",
"name": "Training Feedback",
diff --git a/erpnext/loan_management/loan_common.js b/erpnext/loan_management/loan_common.js
index 43980ffef48e..247e30b84393 100644
--- a/erpnext/loan_management/loan_common.js
+++ b/erpnext/loan_management/loan_common.js
@@ -3,11 +3,6 @@
frappe.ui.form.on(cur_frm.doctype, {
refresh: function(frm) {
- if (!frappe.boot.active_domains.includes("Non Profit")) {
- frm.set_df_property('applicant_type', 'options', ['Employee', 'Customer']);
- frm.refresh_field('applicant_type');
- }
-
if (['Loan Disbursement', 'Loan Repayment', 'Loan Interest Accrual', 'Loan Write Off'].includes(frm.doc.doctype)
&& frm.doc.docstatus > 0) {
diff --git a/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.py b/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.py
index 139dcbcdd905..c0770fac90a3 100644
--- a/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.py
+++ b/erpnext/manufacturing/doctype/bom_update_log/bom_update_log.py
@@ -154,7 +154,7 @@ def run_bom_job(
except Exception:
frappe.db.rollback()
- error_log = frappe.log_error(message=frappe.get_traceback(), title=_("BOM Update Tool Error"))
+ error_log = doc.log_error("BOM Update Tool Error")
doc.db_set("status", "Failed")
doc.db_set("error_log", error_log.name)
diff --git a/erpnext/modules.txt b/erpnext/modules.txt
index c6b3159e0fc1..869166b93930 100644
--- a/erpnext/modules.txt
+++ b/erpnext/modules.txt
@@ -12,7 +12,6 @@ Utilities
Assets
Portal
Maintenance
-Education
Regional
ERPNext Integrations
Quality Management
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index d6c44cb3319b..d5b15922ec38 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -333,6 +333,7 @@ erpnext.patches.v13_0.delete_bank_reconciliation_detail
erpnext.patches.v13_0.enable_provisional_accounting
erpnext.patches.v13_0.non_profit_deprecation_warning
erpnext.patches.v13_0.enable_ksa_vat_docs #1
+erpnext.patches.v14_0.delete_education_doctypes
[post_model_sync]
erpnext.patches.v14_0.rename_ongoing_status_in_sla_documents
@@ -365,5 +366,7 @@ erpnext.patches.v13_0.remove_unknown_links_to_prod_plan_items # 24-03-2022
erpnext.patches.v13_0.update_expense_claim_status_for_paid_advances
erpnext.patches.v13_0.create_gst_custom_fields_in_quotation
erpnext.patches.v13_0.copy_custom_field_filters_to_website_item
+erpnext.patches.v13_0.change_default_item_manufacturer_fieldtype
erpnext.patches.v14_0.discount_accounting_separation
erpnext.patches.v14_0.delete_employee_transfer_property_doctype
+erpnext.patches.v13_0.create_accounting_dimensions_in_orders
\ No newline at end of file
diff --git a/erpnext/patches/v11_0/refactor_autoname_naming.py b/erpnext/patches/v11_0/refactor_autoname_naming.py
index de453ccf21dc..fa8f4eb23ef0 100644
--- a/erpnext/patches/v11_0/refactor_autoname_naming.py
+++ b/erpnext/patches/v11_0/refactor_autoname_naming.py
@@ -69,8 +69,6 @@
"Soil Analysis": "AG-ANA-.YY.-.MM.-.#####",
"Soil Texture": "AG-TEX-.YYYY.-.#####",
"Stock Ledger Entry": "MAT-SLE-.YYYY.-.#####",
- "Student Leave Application": "EDU-SLA-.YYYY.-.#####",
- "Student Log": "EDU-SLOG-.YYYY.-.#####",
"Subscription": "ACC-SUB-.YYYY.-.#####",
"Task": "TASK-.YYYY.-.#####",
"Tax Rule": "ACC-TAX-RULE-.YYYY.-.#####",
diff --git a/erpnext/patches/v11_0/refactor_naming_series.py b/erpnext/patches/v11_0/refactor_naming_series.py
index 49458607975b..cdc92fe61fd9 100644
--- a/erpnext/patches/v11_0/refactor_naming_series.py
+++ b/erpnext/patches/v11_0/refactor_naming_series.py
@@ -55,8 +55,6 @@
"Shareholder": "ACC-SH-.YYYY.-",
"Stock Entry": "MAT-STE-.YYYY.-",
"Stock Reconciliation": "MAT-RECO-.YYYY.-",
- "Student": "EDU-STU-.YYYY.-",
- "Student Applicant": "EDU-APP-.YYYY.-",
"Supplier": "SUP-.YYYY.-",
"Supplier Quotation": "PUR-SQTN-.YYYY.-",
"Supplier Scorecard Period": "PU-SSP-.YYYY.-",
diff --git a/erpnext/patches/v11_0/set_department_for_doctypes.py b/erpnext/patches/v11_0/set_department_for_doctypes.py
index 1e14b9ceb0f0..4900458e107d 100644
--- a/erpnext/patches/v11_0/set_department_for_doctypes.py
+++ b/erpnext/patches/v11_0/set_department_for_doctypes.py
@@ -19,7 +19,6 @@ def execute():
"Training Event Employee",
"Payroll Employee Detail",
],
- "education": ["Instructor"],
"projects": ["Activity Cost", "Timesheet"],
"setup": ["Sales Person"],
}
diff --git a/erpnext/patches/v11_0/update_account_type_in_party_type.py b/erpnext/patches/v11_0/update_account_type_in_party_type.py
index e55f9f20cc8a..47252eb98f19 100644
--- a/erpnext/patches/v11_0/update_account_type_in_party_type.py
+++ b/erpnext/patches/v11_0/update_account_type_in_party_type.py
@@ -13,7 +13,6 @@ def execute():
"Employee": "Payable",
"Member": "Receivable",
"Shareholder": "Payable",
- "Student": "Receivable",
}
for party_type, account_type in party_types.items():
diff --git a/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py b/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py
index c069c24cfa54..671dfd116d21 100644
--- a/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py
+++ b/erpnext/patches/v12_0/move_bank_account_swift_number_to_bank.py
@@ -17,7 +17,7 @@ def execute():
"""
)
except Exception as e:
- frappe.log_error(e, title="Patch Migration Failed")
+ frappe.log_error("Bank to Bank Account patch migration failed")
frappe.reload_doc("accounts", "doctype", "bank_account")
frappe.reload_doc("accounts", "doctype", "payment_request")
diff --git a/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py b/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py
index 517a14a83009..ddbb7fd0f1b8 100644
--- a/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py
+++ b/erpnext/patches/v13_0/add_missing_fg_item_for_stock_entry.py
@@ -96,8 +96,7 @@ def repost_stock_entry(doc):
make_sl_entries(sl_entries, True)
except Exception:
print(f"SLE entries not posted for the stock entry {doc.name}")
- traceback = frappe.get_traceback()
- frappe.log_error(traceback)
+ doc.log_error("Stock respost failed")
def get_sle_for_target_warehouse(doc, sl_entries, finished_item_row):
diff --git a/erpnext/patches/v13_0/change_default_item_manufacturer_fieldtype.py b/erpnext/patches/v13_0/change_default_item_manufacturer_fieldtype.py
new file mode 100644
index 000000000000..0b00188e6a8d
--- /dev/null
+++ b/erpnext/patches/v13_0/change_default_item_manufacturer_fieldtype.py
@@ -0,0 +1,16 @@
+import frappe
+
+
+def execute():
+
+ # Erase all default item manufacturers that dont exist.
+ item = frappe.qb.DocType("Item")
+ manufacturer = frappe.qb.DocType("Manufacturer")
+
+ (
+ frappe.qb.update(item)
+ .set(item.default_item_manufacturer, None)
+ .left_join(manufacturer)
+ .on(item.default_item_manufacturer == manufacturer.name)
+ .where(manufacturer.name.isnull() & item.default_item_manufacturer.isnotnull())
+ ).run()
diff --git a/erpnext/patches/v13_0/convert_to_website_item_in_item_card_group_template.py b/erpnext/patches/v13_0/convert_to_website_item_in_item_card_group_template.py
index 020521d5b95d..1bac0fdbf0b5 100644
--- a/erpnext/patches/v13_0/convert_to_website_item_in_item_card_group_template.py
+++ b/erpnext/patches/v13_0/convert_to_website_item_in_item_card_group_template.py
@@ -56,8 +56,5 @@ def make_new_website_item(item: str) -> Union[str, None]:
web_item = make_website_item(doc) # returns [website_item.name, item_name]
return web_item[0]
except Exception:
- title = f"{item}: Error while converting to Website Item "
- frappe.log_error(
- title + "for Item Card Group Template" + "\n\n" + frappe.get_traceback(), title=title
- )
+ doc.log_error("Website Item creation failed")
return None
diff --git a/erpnext/patches/v13_0/create_accounting_dimensions_in_orders.py b/erpnext/patches/v13_0/create_accounting_dimensions_in_orders.py
new file mode 100644
index 000000000000..8a3f1d0a58f4
--- /dev/null
+++ b/erpnext/patches/v13_0/create_accounting_dimensions_in_orders.py
@@ -0,0 +1,39 @@
+import frappe
+from frappe.custom.doctype.custom_field.custom_field import create_custom_field
+
+
+def execute():
+ accounting_dimensions = frappe.db.get_all(
+ "Accounting Dimension", fields=["fieldname", "label", "document_type", "disabled"]
+ )
+
+ if not accounting_dimensions:
+ return
+
+ count = 1
+ for d in accounting_dimensions:
+
+ if count % 2 == 0:
+ insert_after_field = "dimension_col_break"
+ else:
+ insert_after_field = "accounting_dimensions_section"
+
+ for doctype in ["Purchase Order", "Purchase Receipt", "Sales Order"]:
+
+ field = frappe.db.get_value("Custom Field", {"dt": doctype, "fieldname": d.fieldname})
+
+ if field:
+ continue
+
+ df = {
+ "fieldname": d.fieldname,
+ "label": d.label,
+ "fieldtype": "Link",
+ "options": d.document_type,
+ "insert_after": insert_after_field,
+ }
+
+ create_custom_field(doctype, df, ignore_validate=False)
+ frappe.clear_cache(doctype=doctype)
+
+ count += 1
diff --git a/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py b/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py
index 492e0403ec45..6c64ef6559b1 100644
--- a/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py
+++ b/erpnext/patches/v13_0/modify_invalid_gain_loss_gl_entries.py
@@ -40,7 +40,10 @@ def execute():
)
if purchase_invoices + sales_invoices:
- frappe.log_error(json.dumps(purchase_invoices + sales_invoices, indent=2), title="Patch Log")
+ frappe.log_error(
+ "Fix invalid gain / loss patch log",
+ message=json.dumps(purchase_invoices + sales_invoices, indent=2),
+ )
acc_frozen_upto = frappe.db.get_value("Accounts Settings", None, "acc_frozen_upto")
if acc_frozen_upto:
diff --git a/erpnext/patches/v14_0/delete_education_doctypes.py b/erpnext/patches/v14_0/delete_education_doctypes.py
new file mode 100644
index 000000000000..76b2300fd2a1
--- /dev/null
+++ b/erpnext/patches/v14_0/delete_education_doctypes.py
@@ -0,0 +1,55 @@
+import click
+import frappe
+
+
+def execute():
+ if "education" in frappe.get_installed_apps():
+ return
+
+ frappe.delete_doc("Workspace", "Education", ignore_missing=True, force=True)
+
+ pages = frappe.get_all("Page", {"module": "education"}, pluck="name")
+ for page in pages:
+ frappe.delete_doc("Page", page, ignore_missing=True, force=True)
+
+ reports = frappe.get_all("Report", {"module": "education", "is_standard": "Yes"}, pluck="name")
+ for report in reports:
+ frappe.delete_doc("Report", report, ignore_missing=True, force=True)
+
+ print_formats = frappe.get_all(
+ "Print Format", {"module": "education", "standard": "Yes"}, pluck="name"
+ )
+ for print_format in print_formats:
+ frappe.delete_doc("Print Format", print_format, ignore_missing=True, force=True)
+
+ frappe.reload_doc("website", "doctype", "website_settings")
+ forms = frappe.get_all("Web Form", {"module": "education", "is_standard": 1}, pluck="name")
+ for form in forms:
+ frappe.delete_doc("Web Form", form, ignore_missing=True, force=True)
+
+ dashboards = frappe.get_all("Dashboard", {"module": "education", "is_standard": 1}, pluck="name")
+ for dashboard in dashboards:
+ frappe.delete_doc("Dashboard", dashboard, ignore_missing=True, force=True)
+
+ dashboards = frappe.get_all(
+ "Dashboard Chart", {"module": "education", "is_standard": 1}, pluck="name"
+ )
+ for dashboard in dashboards:
+ frappe.delete_doc("Dashboard Chart", dashboard, ignore_missing=True, force=True)
+
+ frappe.reload_doc("desk", "doctype", "number_card")
+ cards = frappe.get_all("Number Card", {"module": "education", "is_standard": 1}, pluck="name")
+ for card in cards:
+ frappe.delete_doc("Number Card", card, ignore_missing=True, force=True)
+
+ doctypes = frappe.get_all("DocType", {"module": "education", "custom": 0}, pluck="name")
+ for doctype in doctypes:
+ frappe.delete_doc("DocType", doctype, ignore_missing=True)
+
+ frappe.delete_doc("Module Def", "Education", ignore_missing=True, force=True)
+
+ click.secho(
+ "Education Module is moved to a separate app"
+ "Please install the app to continue using the module: https://github.com/frappe/education",
+ fg="yellow",
+ )
diff --git a/erpnext/patches/v14_0/discount_accounting_separation.py b/erpnext/patches/v14_0/discount_accounting_separation.py
index fd498052d8c2..0d1349a3204e 100644
--- a/erpnext/patches/v14_0/discount_accounting_separation.py
+++ b/erpnext/patches/v14_0/discount_accounting_separation.py
@@ -2,8 +2,10 @@
def execute():
- doc = frappe.get_doc("Accounts Settings")
- discount_account = doc.enable_discount_accounting
+ data = frappe.db.sql(
+ 'select value from tabSingles where doctype="Accounts Settings" and field="enable_discount_accounting"'
+ )
+ discount_account = data and int(data[0][0]) or 0
if discount_account:
for doctype in ["Buying Settings", "Selling Settings"]:
frappe.db.set_value(doctype, doctype, "enable_discount_accounting", 1, update_modified=False)
diff --git a/erpnext/patches/v14_0/rename_ongoing_status_in_sla_documents.py b/erpnext/patches/v14_0/rename_ongoing_status_in_sla_documents.py
index 2eb6becb09aa..8ea96abd30fa 100644
--- a/erpnext/patches/v14_0/rename_ongoing_status_in_sla_documents.py
+++ b/erpnext/patches/v14_0/rename_ongoing_status_in_sla_documents.py
@@ -18,4 +18,4 @@ def execute():
).run()
except Exception:
- frappe.log_error(title="Failed to Patch SLA Status")
+ frappe.log_error("Failed to Patch SLA Status")
diff --git a/erpnext/payroll/doctype/salary_slip/salary_slip.py b/erpnext/payroll/doctype/salary_slip/salary_slip.py
index 192232949a94..6a7f72b01329 100644
--- a/erpnext/payroll/doctype/salary_slip/salary_slip.py
+++ b/erpnext/payroll/doctype/salary_slip/salary_slip.py
@@ -375,13 +375,19 @@ def get_unmarked_days(self, include_holidays_in_total_working_days):
if joining_date and (getdate(self.start_date) < joining_date <= getdate(self.end_date)):
start_date = joining_date
unmarked_days = self.get_unmarked_days_based_on_doj_or_relieving(
- unmarked_days, include_holidays_in_total_working_days, self.start_date, joining_date
+ unmarked_days,
+ include_holidays_in_total_working_days,
+ self.start_date,
+ add_days(joining_date, -1),
)
if relieving_date and (getdate(self.start_date) <= relieving_date < getdate(self.end_date)):
end_date = relieving_date
unmarked_days = self.get_unmarked_days_based_on_doj_or_relieving(
- unmarked_days, include_holidays_in_total_working_days, relieving_date, self.end_date
+ unmarked_days,
+ include_holidays_in_total_working_days,
+ add_days(relieving_date, 1),
+ self.end_date,
)
# exclude days for which attendance has been marked
@@ -407,10 +413,10 @@ def get_unmarked_days_based_on_doj_or_relieving(
from erpnext.hr.doctype.employee.employee import is_holiday
if include_holidays_in_total_working_days:
- unmarked_days -= date_diff(end_date, start_date)
+ unmarked_days -= date_diff(end_date, start_date) + 1
else:
# exclude only if not holidays
- for days in range(date_diff(end_date, start_date)):
+ for days in range(date_diff(end_date, start_date) + 1):
date = add_days(end_date, -days)
if not is_holiday(self.employee, date):
unmarked_days -= 1
diff --git a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py
index 869ea83f2721..1bc374192281 100644
--- a/erpnext/payroll/doctype/salary_slip/test_salary_slip.py
+++ b/erpnext/payroll/doctype/salary_slip/test_salary_slip.py
@@ -128,19 +128,79 @@ def test_payment_days_based_on_attendance(self):
},
)
def test_payment_days_for_mid_joinee_including_holidays(self):
- from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday
-
no_of_days = self.get_no_of_days()
month_start_date, month_end_date = get_first_day(nowdate()), get_last_day(nowdate())
new_emp_id = make_employee("test_payment_days_based_on_joining_date@salary.com")
joining_date, relieving_date = add_days(month_start_date, 3), add_days(month_end_date, -5)
+
+ for days in range(date_diff(month_end_date, month_start_date) + 1):
+ date = add_days(month_start_date, days)
+ mark_attendance(new_emp_id, date, "Present", ignore_validate=True)
+
+ # Case 1: relieving in mid month
+ frappe.db.set_value(
+ "Employee",
+ new_emp_id,
+ {"date_of_joining": month_start_date, "relieving_date": relieving_date, "status": "Active"},
+ )
+
+ new_ss = make_employee_salary_slip(
+ "test_payment_days_based_on_joining_date@salary.com",
+ "Monthly",
+ "Test Payment Based On Attendence",
+ )
+ self.assertEqual(new_ss.payment_days, no_of_days[0] - 5)
+
+ # Case 2: joining in mid month
+ frappe.db.set_value(
+ "Employee",
+ new_emp_id,
+ {"date_of_joining": joining_date, "relieving_date": month_end_date, "status": "Active"},
+ )
+
+ frappe.delete_doc("Salary Slip", new_ss.name, force=True)
+ new_ss = make_employee_salary_slip(
+ "test_payment_days_based_on_joining_date@salary.com",
+ "Monthly",
+ "Test Payment Based On Attendence",
+ )
+ self.assertEqual(new_ss.payment_days, no_of_days[0] - 3)
+
+ # Case 3: joining and relieving in mid-month
frappe.db.set_value(
"Employee",
new_emp_id,
{"date_of_joining": joining_date, "relieving_date": relieving_date, "status": "Left"},
)
+ frappe.delete_doc("Salary Slip", new_ss.name, force=True)
+ new_ss = make_employee_salary_slip(
+ "test_payment_days_based_on_joining_date@salary.com",
+ "Monthly",
+ "Test Payment Based On Attendence",
+ )
+
+ self.assertEqual(new_ss.total_working_days, no_of_days[0])
+ self.assertEqual(new_ss.payment_days, no_of_days[0] - 8)
+
+ @change_settings(
+ "Payroll Settings",
+ {
+ "payroll_based_on": "Attendance",
+ "consider_unmarked_attendance_as": "Absent",
+ "include_holidays_in_total_working_days": True,
+ },
+ )
+ def test_payment_days_for_mid_joinee_including_holidays_and_unmarked_days(self):
+ # tests mid month joining and relieving along with unmarked days
+ from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday
+
+ no_of_days = self.get_no_of_days()
+ month_start_date, month_end_date = get_first_day(nowdate()), get_last_day(nowdate())
+
+ new_emp_id = make_employee("test_payment_days_based_on_joining_date@salary.com")
+ joining_date, relieving_date = add_days(month_start_date, 3), add_days(month_end_date, -5)
holidays = 0
for days in range(date_diff(relieving_date, joining_date) + 1):
@@ -150,6 +210,12 @@ def test_payment_days_for_mid_joinee_including_holidays(self):
else:
holidays += 1
+ frappe.db.set_value(
+ "Employee",
+ new_emp_id,
+ {"date_of_joining": joining_date, "relieving_date": relieving_date, "status": "Left"},
+ )
+
new_ss = make_employee_salary_slip(
"test_payment_days_based_on_joining_date@salary.com",
"Monthly",
diff --git a/erpnext/portal/utils.py b/erpnext/portal/utils.py
index 09d100708e35..7be8c5df1801 100644
--- a/erpnext/portal/utils.py
+++ b/erpnext/portal/utils.py
@@ -23,10 +23,6 @@ def set_default_role(doc, method):
doc.add_roles("Customer")
elif link.link_doctype == "Supplier" and "Supplier" not in roles:
doc.add_roles("Supplier")
- elif frappe.get_value("Student", dict(student_email_id=doc.email)) and "Student" not in roles:
- doc.add_roles("Student")
- elif frappe.get_value("Guardian", dict(email_address=doc.email)) and "Guardian" not in roles:
- doc.add_roles("Guardian")
def create_customer_or_supplier():
diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py
index 29f1ce455e32..8a8e1d1bf5eb 100644
--- a/erpnext/projects/doctype/project/project.py
+++ b/erpnext/projects/doctype/project/project.py
@@ -9,9 +9,9 @@
from frappe.model.document import Document
from frappe.utils import add_days, flt, get_datetime, get_time, get_url, nowtime, today
+from erpnext import get_default_company
from erpnext.controllers.employee_boarding_controller import update_employee_boarding_status
from erpnext.controllers.queries import get_filters_cond
-from erpnext.education.doctype.student_attendance.student_attendance import get_holiday_list
from erpnext.hr.doctype.daily_work_summary.daily_work_summary import get_users_email
from erpnext.hr.doctype.holiday_list.holiday_list import is_holiday
@@ -86,6 +86,7 @@ def create_task_from_template(self, task_details):
type=task_details.type,
issue=task_details.issue,
is_group=task_details.is_group,
+ color=task_details.color,
)
).insert()
@@ -665,3 +666,17 @@ def set_project_status(project, status):
project.status = status
project.save()
+
+
+def get_holiday_list(company=None):
+ if not company:
+ company = get_default_company() or frappe.get_all("Company")[0].name
+
+ holiday_list = frappe.get_cached_value("Company", company, "default_holiday_list")
+ if not holiday_list:
+ frappe.throw(
+ _("Please set a default Holiday List for Company {0}").format(
+ frappe.bold(get_default_company())
+ )
+ )
+ return holiday_list
diff --git a/erpnext/public/js/education/assessment_result_tool.html b/erpnext/public/js/education/assessment_result_tool.html
deleted file mode 100644
index f7d1ab39fcff..000000000000
--- a/erpnext/public/js/education/assessment_result_tool.html
+++ /dev/null
@@ -1,72 +0,0 @@
-
diff --git a/erpnext/public/js/education/lms/quiz.js b/erpnext/public/js/education/lms/quiz.js
deleted file mode 100644
index 66160a7610cb..000000000000
--- a/erpnext/public/js/education/lms/quiz.js
+++ /dev/null
@@ -1,238 +0,0 @@
-class Quiz {
- constructor(wrapper, options) {
- this.wrapper = wrapper;
- Object.assign(this, options);
- this.questions = []
- this.refresh();
- }
-
- refresh() {
- this.get_quiz();
- }
-
- get_quiz() {
- frappe.call('erpnext.education.utils.get_quiz', {
- quiz_name: this.name,
- course: this.course
- }).then(res => {
- this.make(res.message)
- });
- }
-
- make(data) {
- if (data.is_time_bound) {
- $(".lms-timer").removeClass("hide");
- if (!data.activity || (data.activity && !data.activity.is_complete)) {
- this.initialiseTimer(data.duration);
- this.is_time_bound = true;
- this.time_taken = 0;
- }
- }
- data.questions.forEach(question_data => {
- let question_wrapper = document.createElement('div');
- let question = new Question({
- wrapper: question_wrapper,
- ...question_data
- });
- this.questions.push(question)
- this.wrapper.appendChild(question_wrapper);
- })
- if (data.activity && data.activity.is_complete) {
- this.disable()
- let indicator = 'red'
- let message = 'Your are not allowed to attempt the quiz again.'
- if (data.activity.result == 'Pass') {
- indicator = 'green'
- message = 'You have already cleared the quiz.'
- }
- if (data.activity.time_taken) {
- this.calculate_and_display_time(data.activity.time_taken, "Time Taken - ");
- }
- this.set_quiz_footer(message, indicator, data.activity.score)
- }
- else {
- this.make_actions();
- }
- window.addEventListener('beforeunload', (event) => {
- event.preventDefault();
- event.returnValue = '';
- });
- }
-
- initialiseTimer(duration) {
- this.time_left = duration;
- var self = this;
- var old_diff;
- this.calculate_and_display_time(this.time_left, "Time Left - ");
- this.start_time = new Date().getTime();
- this.timer = setInterval(function () {
- var diff = (new Date().getTime() - self.start_time)/1000;
- var variation = old_diff ? diff - old_diff : diff;
- old_diff = diff;
- self.time_left -= variation;
- self.time_taken += variation;
- self.calculate_and_display_time(self.time_left, "Time Left - ");
- if (self.time_left <= 0) {
- clearInterval(self.timer);
- self.time_taken -= 1;
- self.submit();
- }
- }, 1000);
- }
-
- calculate_and_display_time(second, text) {
- var timer_display = document.getElementsByClassName("lms-timer")[0];
- var hours = this.append_zero(Math.floor(second / 3600));
- var minutes = this.append_zero(Math.floor(second % 3600 / 60));
- var seconds = this.append_zero(Math.ceil(second % 3600 % 60));
- timer_display.innerText = text + hours + ":" + minutes + ":" + seconds;
- }
-
- append_zero(time) {
- return time > 9 ? time : "0" + time;
- }
-
- make_actions() {
- const button = document.createElement("button");
- button.classList.add("btn", "btn-primary", "mt-5", "mr-2");
-
- button.id = 'submit-button';
- button.innerText = 'Submit';
- button.onclick = () => this.submit();
- this.submit_btn = button
- this.wrapper.appendChild(button);
- }
-
- submit() {
- if (this.is_time_bound) {
- clearInterval(this.timer);
- $(".lms-timer").text("");
- }
- this.submit_btn.innerText = 'Evaluating..'
- this.submit_btn.disabled = true
- this.disable()
- frappe.call('erpnext.education.utils.evaluate_quiz', {
- quiz_name: this.name,
- quiz_response: this.get_selected(),
- course: this.course,
- program: this.program,
- time_taken: this.is_time_bound ? this.time_taken : 0
- }).then(res => {
- this.submit_btn.remove()
- if (!res.message) {
- frappe.throw(__("Something went wrong while evaluating the quiz."))
- }
-
- let indicator = 'red'
- let message = 'Fail'
- if (res.message.status == 'Pass') {
- indicator = 'green'
- message = 'Congratulations, you cleared the quiz.'
- }
-
- this.set_quiz_footer(message, indicator, res.message.score)
- });
- }
-
- set_quiz_footer(message, indicator, score) {
- const div = document.createElement("div");
- div.classList.add("mt-5");
- div.innerHTML = `
-
-
${message}
- Score: ${score}/100
-
-
-
`
-
- this.wrapper.appendChild(div)
- }
-
- disable() {
- this.questions.forEach(que => que.disable())
- }
-
- get_selected() {
- let que = {}
- this.questions.forEach(question => {
- que[question.name] = question.get_selected()
- })
- return que
- }
-}
-
-class Question {
- constructor(opts) {
- Object.assign(this, opts);
- this.make();
- }
-
- make() {
- this.make_question()
- this.make_options()
- }
-
- get_selected() {
- let selected = this.options.filter(opt => opt.input.checked)
- if (this.type == 'Single Correct Answer') {
- if (selected[0]) return selected[0].name
- }
- if (this.type == 'Multiple Correct Answer') {
- return selected.map(opt => opt.name)
- }
- return null
- }
-
- disable() {
- let selected = this.options.forEach(opt => opt.input.disabled = true)
- }
-
- make_question() {
- let question_wrapper = document.createElement('h5');
- question_wrapper.classList.add('mt-3');
- question_wrapper.innerHTML = this.question;
- this.wrapper.appendChild(question_wrapper);
- }
-
- make_options() {
- let make_input = (name, value) => {
- let input = document.createElement('input');
- input.id = name;
- input.name = this.name;
- input.value = value;
- input.type = 'radio';
- if (this.type == 'Multiple Correct Answer')
- input.type = 'checkbox';
- input.classList.add('form-check-input');
- return input;
- }
-
- let make_label = function (name, value) {
- let label = document.createElement('label');
- label.classList.add('form-check-label');
- label.htmlFor = name;
- label.innerText = value;
- return label
- }
-
- let make_option = function (wrapper, option) {
- let option_div = document.createElement('div');
- option_div.classList.add('form-check', 'pb-1');
- let input = make_input(option.name, option.option);
- let label = make_label(option.name, option.option);
- option_div.appendChild(input);
- option_div.appendChild(label);
- wrapper.appendChild(option_div);
- return { input: input, ...option };
- }
-
- let options_wrapper = document.createElement('div')
- options_wrapper.classList.add('ml-2')
- let option_list = []
- this.options.forEach(opt => option_list.push(make_option(options_wrapper, opt)))
- this.options = option_list
- this.wrapper.appendChild(options_wrapper)
- }
-}
diff --git a/erpnext/public/js/erpnext.bundle.js b/erpnext/public/js/erpnext.bundle.js
index 3baf66784fdb..3dae6d407ba7 100644
--- a/erpnext/public/js/erpnext.bundle.js
+++ b/erpnext/public/js/erpnext.bundle.js
@@ -16,7 +16,6 @@ import "./templates/item_quick_entry.html";
import "./utils/item_quick_entry";
import "./utils/customer_quick_entry";
import "./utils/supplier_quick_entry";
-import "./education/assessment_result_tool.html";
import "./call_popup/call_popup";
import "./utils/dimension_tree_filter";
import "./utils/barcode_scanner";
diff --git a/erpnext/public/js/setup_wizard.js b/erpnext/public/js/setup_wizard.js
index 83b69aebc5b4..9288f515cd47 100644
--- a/erpnext/public/js/setup_wizard.js
+++ b/erpnext/public/js/setup_wizard.js
@@ -12,37 +12,6 @@ frappe.setup.on("before_load", function () {
});
erpnext.setup.slides_settings = [
- {
- // Domain
- name: 'domain',
- title: __('Select your Domains'),
- fields: [
- {
- fieldname: 'domains',
- label: __('Domains'),
- fieldtype: 'MultiCheck',
- options: [
- { "label": __("Distribution"), "value": "Distribution" },
- { "label": __("Education"), "value": "Education" },
- { "label": __("Manufacturing"), "value": "Manufacturing" },
- { "label": __("Retail"), "value": "Retail" },
- { "label": __("Services"), "value": "Services" },
- { "label": __("Healthcare (beta)"), "value": "Healthcare" },
- { "label": __("Non Profit (beta)"), "value": "Non Profit" }
- ], reqd: 1
- },
- ],
- // help: __('Select the nature of your business.'),
- validate: function () {
- if (this.values.domains.length === 0) {
- frappe.msgprint(__("Please select at least one domain."));
- return false;
- }
- frappe.setup.domains = this.values.domains;
- return true;
- },
- },
-
{
// Brand
name: 'brand',
@@ -59,15 +28,13 @@ erpnext.setup.slides_settings = [
},
{
fieldname: 'company_name',
- label: frappe.setup.domains.includes('Education') ?
- __('Institute Name') : __('Company Name'),
+ label: __('Company Name'),
fieldtype: 'Data',
reqd: 1
},
{
fieldname: 'company_abbr',
- label: frappe.setup.domains.includes('Education') ?
- __('Institute Abbreviation') : __('Company Abbreviation'),
+ label: __('Company Abbreviation'),
fieldtype: 'Data'
}
],
@@ -107,17 +74,12 @@ erpnext.setup.slides_settings = [
name: 'organisation',
title: __("Your Organization"),
icon: "fa fa-building",
- // help: frappe.setup.domains.includes('Education') ?
- // __('The name of the institute for which you are setting up this system.') :
- // __('The name of your company for which you are setting up this system.')),
fields: [
{
fieldname: 'company_tagline',
label: __('What does it do?'),
fieldtype: 'Data',
- placeholder: frappe.setup.domains.includes('Education') ?
- __('e.g. "Primary School" or "University"') :
- __('e.g. "Build tools for builders"'),
+ placeholder: __('e.g. "Build tools for builders"'),
reqd: 1
},
{ fieldname: 'bank_account', label: __('Bank Name'), fieldtype: 'Data', reqd: 1 },
diff --git a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py
index 77c4d7c6ca3f..34701c140d64 100644
--- a/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py
+++ b/erpnext/regional/doctype/import_supplier_invoice/import_supplier_invoice.py
@@ -160,7 +160,7 @@ def get_file_content(file_name, zip_file_object):
try:
content = encoded_content.decode("utf-16")
except UnicodeDecodeError as e:
- frappe.log_error(message=e, title="UTF-16 encoding error for File Name: " + file_name)
+ frappe.log_error("UTF-16 encoding error for File Name: " + file_name)
return content
@@ -390,9 +390,7 @@ def create_purchase_invoice(supplier_name, file_name, args, name):
return pi.name
except Exception as e:
frappe.db.set_value("Import Supplier Invoice", name, "status", "Error")
- frappe.log_error(
- message=e, title="Create Purchase Invoice: " + args.get("bill_no") + "File Name: " + file_name
- )
+ pi.log_error("Unable to create Puchase Invoice")
return None
diff --git a/erpnext/regional/india/e_invoice/utils.py b/erpnext/regional/india/e_invoice/utils.py
index 0f73c5f9bc15..df3981a5e9d6 100644
--- a/erpnext/regional/india/e_invoice/utils.py
+++ b/erpnext/regional/india/e_invoice/utils.py
@@ -57,6 +57,7 @@ def validate_eligibility(doc):
invalid_company = not frappe.db.get_value("E Invoice User", {"company": doc.get("company")})
invalid_supply_type = doc.get("gst_category") not in [
"Registered Regular",
+ "Registered Composition",
"SEZ",
"Overseas",
"Deemed Export",
@@ -124,24 +125,33 @@ def read_json(name):
def get_transaction_details(invoice):
supply_type = ""
- if invoice.gst_category == "Registered Regular":
+ if (
+ invoice.gst_category == "Registered Regular" or invoice.gst_category == "Registered Composition"
+ ):
supply_type = "B2B"
elif invoice.gst_category == "SEZ":
- supply_type = "SEZWOP"
+ if invoice.export_type == "Without Payment of Tax":
+ supply_type = "SEZWOP"
+ else:
+ supply_type = "SEZWP"
elif invoice.gst_category == "Overseas":
- supply_type = "EXPWOP"
+ if invoice.export_type == "Without Payment of Tax":
+ supply_type = "EXPWOP"
+ else:
+ supply_type = "EXPWP"
elif invoice.gst_category == "Deemed Export":
supply_type = "DEXP"
if not supply_type:
- rr, sez, overseas, export = (
+ rr, rc, sez, overseas, export = (
bold("Registered Regular"),
+ bold("Registered Composition"),
bold("SEZ"),
bold("Overseas"),
bold("Deemed Export"),
)
frappe.throw(
- _("GST category should be one of {}, {}, {}, {}").format(rr, sez, overseas, export),
+ _("GST category should be one of {}, {}, {}, {}, {}").format(rr, rc, sez, overseas, export),
title=_("Invalid Supply Type"),
)
diff --git a/erpnext/regional/india/setup.py b/erpnext/regional/india/setup.py
index 062c2ef5c598..e41cd34c7299 100644
--- a/erpnext/regional/india/setup.py
+++ b/erpnext/regional/india/setup.py
@@ -762,7 +762,7 @@ def get_custom_fields():
insert_after="customer",
no_copy=1,
print_hide=1,
- depends_on='eval:in_list(["Registered Regular", "SEZ", "Overseas", "Deemed Export"], doc.gst_category) && doc.irn_cancelled === 0',
+ depends_on='eval:in_list(["Registered Regular", "Registered Composition", "SEZ", "Overseas", "Deemed Export"], doc.gst_category) && doc.irn_cancelled === 0',
),
dict(
fieldname="irn_cancelled",
diff --git a/erpnext/regional/report/vat_audit_report/vat_audit_report.py b/erpnext/regional/report/vat_audit_report/vat_audit_report.py
index 6e5982465cf7..70f2c0a33394 100644
--- a/erpnext/regional/report/vat_audit_report/vat_audit_report.py
+++ b/erpnext/regional/report/vat_audit_report/vat_audit_report.py
@@ -95,10 +95,9 @@ def get_invoice_items(self, doctype):
as_dict=1,
)
for d in items:
- if d.item_code not in self.invoice_items.get(d.parent, {}):
- self.invoice_items.setdefault(d.parent, {}).setdefault(d.item_code, {"net_amount": 0.0})
- self.invoice_items[d.parent][d.item_code]["net_amount"] += d.get("base_net_amount", 0)
- self.invoice_items[d.parent][d.item_code]["is_zero_rated"] = d.is_zero_rated
+ self.invoice_items.setdefault(d.parent, {}).setdefault(d.item_code, {"net_amount": 0.0})
+ self.invoice_items[d.parent][d.item_code]["net_amount"] += d.get("base_net_amount", 0)
+ self.invoice_items[d.parent][d.item_code]["is_zero_rated"] = d.is_zero_rated
def get_items_based_on_tax_rate(self, doctype):
self.items_based_on_tax_rate = frappe._dict()
@@ -110,7 +109,7 @@ def get_items_based_on_tax_rate(self, doctype):
self.tax_details = frappe.db.sql(
"""
SELECT
- parent, account_head, item_wise_tax_detail, base_tax_amount_after_discount_amount
+ parent, account_head, item_wise_tax_detail
FROM
`tab%s`
WHERE
@@ -123,7 +122,7 @@ def get_items_based_on_tax_rate(self, doctype):
tuple([doctype] + list(self.invoices.keys())),
)
- for parent, account, item_wise_tax_detail, tax_amount in self.tax_details:
+ for parent, account, item_wise_tax_detail in self.tax_details:
if item_wise_tax_detail:
try:
if account in self.sa_vat_accounts:
@@ -135,7 +134,7 @@ def get_items_based_on_tax_rate(self, doctype):
# to skip items with non-zero tax rate in multiple rows
if taxes[0] == 0 and not is_zero_rated:
continue
- tax_rate, item_amount_map = self.get_item_amount_map(parent, item_code, taxes)
+ tax_rate = self.get_item_amount_map(parent, item_code, taxes)
if tax_rate is not None:
rate_based_dict = self.items_based_on_tax_rate.setdefault(parent, {}).setdefault(
@@ -151,16 +150,22 @@ def get_item_amount_map(self, parent, item_code, taxes):
tax_rate = taxes[0]
tax_amount = taxes[1]
gross_amount = net_amount + tax_amount
- item_amount_map = self.item_tax_rate.setdefault(parent, {}).setdefault(item_code, [])
- amount_dict = {
- "tax_rate": tax_rate,
- "gross_amount": gross_amount,
- "tax_amount": tax_amount,
- "net_amount": net_amount,
- }
- item_amount_map.append(amount_dict)
- return tax_rate, item_amount_map
+ self.item_tax_rate.setdefault(parent, {}).setdefault(
+ item_code,
+ {
+ "tax_rate": tax_rate,
+ "gross_amount": 0.0,
+ "tax_amount": 0.0,
+ "net_amount": 0.0,
+ },
+ )
+
+ self.item_tax_rate[parent][item_code]["net_amount"] += net_amount
+ self.item_tax_rate[parent][item_code]["tax_amount"] += tax_amount
+ self.item_tax_rate[parent][item_code]["gross_amount"] += gross_amount
+
+ return tax_rate
def get_conditions(self):
conditions = ""
@@ -205,9 +210,10 @@ def get_consolidated_data(self, doctype):
for inv, inv_data in self.invoices.items():
if self.items_based_on_tax_rate.get(inv):
for rate, items in self.items_based_on_tax_rate.get(inv).items():
+ row = {"tax_amount": 0.0, "gross_amount": 0.0, "net_amount": 0.0}
+
consolidated_data_map.setdefault(rate, {"data": []})
for item in items:
- row = {}
item_details = self.item_tax_rate.get(inv).get(item)
row["account"] = inv_data.get("account")
row["posting_date"] = formatdate(inv_data.get("posting_date"), "dd-mm-yyyy")
@@ -216,10 +222,11 @@ def get_consolidated_data(self, doctype):
row["party_type"] = "Customer" if doctype == "Sales Invoice" else "Supplier"
row["party"] = inv_data.get("party")
row["remarks"] = inv_data.get("remarks")
- row["gross_amount"] = item_details[0].get("gross_amount")
- row["tax_amount"] = item_details[0].get("tax_amount")
- row["net_amount"] = item_details[0].get("net_amount")
- consolidated_data_map[rate]["data"].append(row)
+ row["gross_amount"] += item_details.get("gross_amount")
+ row["tax_amount"] += item_details.get("tax_amount")
+ row["net_amount"] += item_details.get("net_amount")
+
+ consolidated_data_map[rate]["data"].append(row)
return consolidated_data_map
diff --git a/erpnext/regional/united_arab_emirates/setup.py b/erpnext/regional/united_arab_emirates/setup.py
index cc647f851985..c77fdcc142d1 100644
--- a/erpnext/regional/united_arab_emirates/setup.py
+++ b/erpnext/regional/united_arab_emirates/setup.py
@@ -244,7 +244,7 @@ def make_custom_fields():
"Supplier Quotation Item": invoice_item_fields,
}
- create_custom_fields(custom_fields)
+ create_custom_fields(custom_fields, ignore_validate=True)
def add_print_formats():
diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js
index 26c9996dba96..6b6ea89b6387 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.js
+++ b/erpnext/selling/doctype/sales_order/sales_order.js
@@ -65,7 +65,11 @@ frappe.ui.form.on("Sales Order", {
frm.set_value('transaction_date', frappe.datetime.get_today())
}
erpnext.queries.setup_queries(frm, "Warehouse", function() {
- return erpnext.queries.warehouse(frm.doc);
+ return {
+ filters: [
+ ["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
+ ]
+ };
});
frm.set_query('project', function(doc, cdt, cdn) {
@@ -77,7 +81,19 @@ frappe.ui.form.on("Sales Order", {
}
});
- erpnext.queries.setup_warehouse_query(frm);
+ frm.set_query('warehouse', 'items', function(doc, cdt, cdn) {
+ let row = locals[cdt][cdn];
+ let query = {
+ filters: [
+ ["Warehouse", "company", "in", ["", cstr(frm.doc.company)]],
+ ]
+ };
+ if (row.item_code) {
+ query.query = "erpnext.controllers.queries.warehouse_query";
+ query.filters.push(["Bin", "item_code", "=", row.item_code]);
+ }
+ return query;
+ });
frm.ignore_doctypes_on_cancel_all = ['Purchase Order'];
},
diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json
index 1d0432bddbee..ff921c721df4 100644
--- a/erpnext/selling/doctype/sales_order/sales_order.json
+++ b/erpnext/selling/doctype/sales_order/sales_order.json
@@ -25,6 +25,10 @@
"po_no",
"po_date",
"tax_id",
+ "accounting_dimensions_section",
+ "cost_center",
+ "dimension_col_break",
+ "project",
"contact_info",
"customer_address",
"address_display",
@@ -113,7 +117,6 @@
"is_internal_customer",
"represents_company",
"inter_company_order_reference",
- "project",
"party_account_currency",
"column_break_77",
"source",
@@ -1522,13 +1525,29 @@
"label": "% Picked",
"no_copy": 1,
"read_only": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "accounting_dimensions_section",
+ "fieldtype": "Section Break",
+ "label": "Accounting Dimensions"
+ },
+ {
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center"
+ },
+ {
+ "fieldname": "dimension_col_break",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-file-text",
"idx": 105,
"is_submittable": 1,
"links": [],
- "modified": "2022-04-21 08:16:48.316074",
+ "modified": "2022-04-26 14:38:18.350207",
"modified_by": "Administrator",
"module": "Selling",
"name": "Sales Order",
diff --git a/erpnext/selling/workspace/selling/selling.json b/erpnext/selling/workspace/selling/selling.json
index a700ad89a325..45e160d143ee 100644
--- a/erpnext/selling/workspace/selling/selling.json
+++ b/erpnext/selling/workspace/selling/selling.json
@@ -5,7 +5,7 @@
"label": "Sales Order Trends"
}
],
- "content": "[{\"type\":\"onboarding\",\"data\":{\"onboarding_name\":\"Selling\",\"col\":12}},{\"type\":\"chart\",\"data\":{\"chart_name\":\"Sales Order Trends\",\"col\":12}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"Quick Access \",\"col\":12}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Item\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Sales Order\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Sales Analytics\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Sales Order Analysis\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"Reports & Masters \",\"col\":12}},{\"type\":\"card\",\"data\":{\"card_name\":\"Selling\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Items and Pricing\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Settings\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Key Reports\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Other Reports\",\"col\":4}}]",
+ "content": "[{\"type\":\"onboarding\",\"data\":{\"onboarding_name\":\"Selling\",\"col\":12}},{\"type\":\"chart\",\"data\":{\"chart_name\":\"Sales Order Trends\",\"col\":12}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"Quick Access \",\"col\":12}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Item\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Sales Order\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Sales Analytics\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Sales Order Analysis\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"type\":\"spacer\",\"data\":{\"col\":12}},{\"type\":\"header\",\"data\":{\"text\":\"Reports & Masters \",\"col\":12}},{\"type\":\"card\",\"data\":{\"card_name\":\"Selling\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Items and Pricing\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Settings\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Key Reports\",\"col\":4}},{\"type\":\"card\",\"data\":{\"card_name\":\"Other Reports\",\"col\":4}}]",
"creation": "2020-01-28 11:49:12.092882",
"docstatus": 0,
"doctype": "Workspace",
@@ -317,8 +317,148 @@
{
"hidden": 0,
"is_query_report": 0,
- "label": "Key Reports",
+ "label": "Other Reports",
+ "link_count": 12,
+ "onboard": 0,
+ "type": "Card Break"
+ },
+ {
+ "dependencies": "Lead",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Lead Details",
+ "link_count": 0,
+ "link_to": "Lead Details",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Address",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Customer Addresses And Contacts",
+ "link_count": 0,
+ "link_to": "Address And Contacts",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Item",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Available Stock for Packing Items",
+ "link_count": 0,
+ "link_to": "Available Stock for Packing Items",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Sales Order",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Pending SO Items For Purchase Request",
+ "link_count": 0,
+ "link_to": "Pending SO Items For Purchase Request",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Delivery Note",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Delivery Note Trends",
+ "link_count": 0,
+ "link_to": "Delivery Note Trends",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Sales Invoice",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Sales Invoice Trends",
+ "link_count": 0,
+ "link_to": "Sales Invoice Trends",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Customer",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Customer Credit Balance",
+ "link_count": 0,
+ "link_to": "Customer Credit Balance",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Customer",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Customers Without Any Sales Transactions",
+ "link_count": 0,
+ "link_to": "Customers Without Any Sales Transactions",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Customer",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Sales Partners Commission",
+ "link_count": 0,
+ "link_to": "Sales Partners Commission",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Sales Order",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Territory Target Variance Based On Item Group",
+ "link_count": 0,
+ "link_to": "Territory Target Variance Based On Item Group",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Sales Order",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Sales Person Target Variance Based On Item Group",
+ "link_count": 0,
+ "link_to": "Sales Person Target Variance Based On Item Group",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "dependencies": "Sales Order",
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Sales Partner Target Variance Based On Item Group",
"link_count": 0,
+ "link_to": "Sales Partner Target Variance based on Item Group",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
+ },
+ {
+ "hidden": 0,
+ "is_query_report": 0,
+ "label": "Key Reports",
+ "link_count": 22,
"onboard": 0,
"type": "Card Break"
},
@@ -421,14 +561,6 @@
"onboard": 0,
"type": "Link"
},
- {
- "hidden": 0,
- "is_query_report": 0,
- "label": "Other Reports",
- "link_count": 0,
- "onboard": 0,
- "type": "Card Break"
- },
{
"dependencies": "Lead",
"hidden": 0,
@@ -560,9 +692,19 @@
"link_type": "Report",
"onboard": 0,
"type": "Link"
+ },
+ {
+ "hidden": 0,
+ "is_query_report": 1,
+ "label": "Payment Terms Status for Sales Order",
+ "link_count": 0,
+ "link_to": "Payment Terms Status for Sales Order",
+ "link_type": "Report",
+ "onboard": 0,
+ "type": "Link"
}
],
- "modified": "2022-01-13 17:43:02.778627",
+ "modified": "2022-04-26 13:29:55.087240",
"modified_by": "Administrator",
"module": "Selling",
"name": "Selling",
diff --git a/erpnext/setup/doctype/company/company.json b/erpnext/setup/doctype/company/company.json
index 370a3278a01b..cc62a2ac7307 100644
--- a/erpnext/setup/doctype/company/company.json
+++ b/erpnext/setup/doctype/company/company.json
@@ -147,9 +147,8 @@
},
{
"fieldname": "domain",
- "fieldtype": "Link",
- "label": "Domain",
- "options": "Domain"
+ "fieldtype": "Data",
+ "label": "Domain"
},
{
"fieldname": "parent_company",
@@ -748,7 +747,7 @@
"image_field": "company_logo",
"is_tree": 1,
"links": [],
- "modified": "2022-01-25 10:33:16.826067",
+ "modified": "2022-04-27 10:33:16.826067",
"modified_by": "Administrator",
"module": "Setup",
"name": "Company",
diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py
index c11645822ff4..9bde6e2c479d 100644
--- a/erpnext/setup/doctype/company/company.py
+++ b/erpnext/setup/doctype/company/company.py
@@ -528,7 +528,7 @@ def install_country_fixtures(company, country):
except ImportError:
pass
except Exception:
- frappe.log_error()
+ frappe.log_error("Unable to set country fixtures")
frappe.throw(
_("Failed to setup defaults for country {0}. Please contact support.").format(
frappe.bold(country)
diff --git a/erpnext/setup/setup_wizard/operations/company_setup.py b/erpnext/setup/setup_wizard/operations/company_setup.py
index 36dd6611766e..aadc98989fa2 100644
--- a/erpnext/setup/setup_wizard/operations/company_setup.py
+++ b/erpnext/setup/setup_wizard/operations/company_setup.py
@@ -30,7 +30,6 @@ def create_fiscal_year_and_company(args):
"country": args.get("country"),
"create_chart_of_accounts_based_on": "Standard Template",
"chart_of_accounts": args.get("chart_of_accounts"),
- "domain": args.get("domains")[0],
}
).insert()
diff --git a/erpnext/setup/setup_wizard/operations/defaults_setup.py b/erpnext/setup/setup_wizard/operations/defaults_setup.py
index 52fdd6a048c9..646f8546c829 100644
--- a/erpnext/setup/setup_wizard/operations/defaults_setup.py
+++ b/erpnext/setup/setup_wizard/operations/defaults_setup.py
@@ -26,9 +26,6 @@ def set_default_settings(args):
system_settings.email_footer_address = args.get("company_name")
system_settings.save()
- domain_settings = frappe.get_single("Domain Settings")
- domain_settings.set_active_domains(args.get("domains"))
-
stock_settings = frappe.get_doc("Stock Settings")
stock_settings.item_naming_by = "Item Code"
stock_settings.valuation_method = "Moving Average"
diff --git a/erpnext/setup/setup_wizard/operations/install_fixtures.py b/erpnext/setup/setup_wizard/operations/install_fixtures.py
index 22831d20bb97..83a42bcbf5ec 100644
--- a/erpnext/setup/setup_wizard/operations/install_fixtures.py
+++ b/erpnext/setup/setup_wizard/operations/install_fixtures.py
@@ -43,14 +43,6 @@
def install(country=None):
records = [
- # domains
- {"doctype": "Domain", "domain": "Distribution"},
- {"doctype": "Domain", "domain": "Manufacturing"},
- {"doctype": "Domain", "domain": "Retail"},
- {"doctype": "Domain", "domain": "Services"},
- {"doctype": "Domain", "domain": "Education"},
- {"doctype": "Domain", "domain": "Healthcare"},
- {"doctype": "Domain", "domain": "Non Profit"},
# ensure at least an empty Address Template exists for this Country
{"doctype": "Address Template", "country": country},
# item group
@@ -376,7 +368,6 @@ def install(country=None):
{"doctype": "Party Type", "party_type": "Supplier", "account_type": "Payable"},
{"doctype": "Party Type", "party_type": "Employee", "account_type": "Payable"},
{"doctype": "Party Type", "party_type": "Shareholder", "account_type": "Payable"},
- {"doctype": "Party Type", "party_type": "Student", "account_type": "Receivable"},
{"doctype": "Opportunity Type", "name": _("Sales")},
{"doctype": "Opportunity Type", "name": _("Support")},
{"doctype": "Opportunity Type", "name": _("Maintenance")},
@@ -397,13 +388,6 @@ def install(country=None):
{"doctype": "Offer Term", "offer_term": _("Incentives")},
{"doctype": "Print Heading", "print_heading": _("Credit Note")},
{"doctype": "Print Heading", "print_heading": _("Debit Note")},
- # Assessment Group
- {
- "doctype": "Assessment Group",
- "assessment_group_name": _("All Assessment Groups"),
- "is_group": 1,
- "parent_assessment_group": "",
- },
# Share Management
{"doctype": "Share Type", "title": _("Equity")},
{"doctype": "Share Type", "title": _("Preference")},
@@ -790,7 +774,6 @@ def install_defaults(args=None):
frappe.db.set_value("Stock Settings", None, "email_footer_address", args.get("company_name"))
set_global_defaults(args)
- set_active_domains(args)
update_stock_settings()
update_shopping_cart_settings(args)
@@ -814,10 +797,6 @@ def set_global_defaults(args):
global_defaults.save()
-def set_active_domains(args):
- frappe.get_single("Domain Settings").set_active_domains(args.get("domains"))
-
-
def update_stock_settings():
stock_settings = frappe.get_doc("Stock Settings")
stock_settings.item_naming_by = "Item Code"
diff --git a/erpnext/setup/setup_wizard/operations/taxes_setup.py b/erpnext/setup/setup_wizard/operations/taxes_setup.py
index 39dc7e332766..2f77dd6ae567 100644
--- a/erpnext/setup/setup_wizard/operations/taxes_setup.py
+++ b/erpnext/setup/setup_wizard/operations/taxes_setup.py
@@ -116,7 +116,7 @@ def update_regional_tax_settings(country, company):
frappe.get_attr(module_name)(country, company)
except Exception as e:
# Log error and ignore if failed to setup regional tax settings
- frappe.log_error()
+ frappe.log_error("Unable to setup regional tax settings")
pass
diff --git a/erpnext/setup/setup_wizard/setup_wizard.py b/erpnext/setup/setup_wizard/setup_wizard.py
index 4cae5191a67e..bd86a5b96931 100644
--- a/erpnext/setup/setup_wizard/setup_wizard.py
+++ b/erpnext/setup/setup_wizard/setup_wizard.py
@@ -36,7 +36,6 @@ def get_setup_stages(args=None):
"tasks": [
{"fn": setup_defaults, "args": args, "fail_msg": _("Failed to setup defaults")},
{"fn": stage_four, "args": args, "fail_msg": _("Failed to create website")},
- {"fn": set_active_domains, "args": args, "fail_msg": _("Failed to add Domain")},
],
},
{
@@ -84,8 +83,3 @@ def setup_complete(args=None):
setup_defaults(args)
stage_four(args)
fin(args)
-
-
-def set_active_domains(args):
- domain_settings = frappe.get_single("Domain Settings")
- domain_settings.set_active_domains(args.get("domains"))
diff --git a/erpnext/setup/utils.py b/erpnext/setup/utils.py
index 2200e6cd1df0..b3ff439d7481 100644
--- a/erpnext/setup/utils.py
+++ b/erpnext/setup/utils.py
@@ -33,10 +33,8 @@ def before_tests():
"email": "test@erpnext.com",
"password": "test",
"chart_of_accounts": "Standard",
- "domains": ["Manufacturing"],
}
)
- _enable_all_domains()
frappe.db.sql("delete from `tabLeave Allocation`")
frappe.db.sql("delete from `tabLeave Application`")
@@ -112,7 +110,7 @@ def get_exchange_rate(from_currency, to_currency, transaction_date=None, args=No
cache.setex(name=key, time=21600, value=flt(value))
return flt(value)
except Exception:
- frappe.log_error(title="Get Exchange Rate")
+ frappe.log_error("Unable to fetch exchange rate")
frappe.msgprint(
_(
"Unable to find exchange rate for {0} to {1} for key date {2}. Please create a Currency Exchange record manually"
@@ -131,17 +129,9 @@ def format_ces_api(data, param):
def enable_all_roles_and_domains():
"""enable all roles and domain for testing"""
- _enable_all_domains()
_enable_all_roles_for_admin()
-def _enable_all_domains():
- domains = frappe.get_all("Domain", pluck="name")
- if not domains:
- return
- frappe.get_single("Domain Settings").set_active_domains(domains)
-
-
def _enable_all_roles_for_admin():
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
diff --git a/erpnext/setup/workspace/erpnext_settings/erpnext_settings.json b/erpnext/setup/workspace/erpnext_settings/erpnext_settings.json
index c5640bc07932..eeb71c7709eb 100644
--- a/erpnext/setup/workspace/erpnext_settings/erpnext_settings.json
+++ b/erpnext/setup/workspace/erpnext_settings/erpnext_settings.json
@@ -1,7 +1,7 @@
{
"charts": [],
"content": "[{\"type\":\"header\",\"data\":{\"text\":\"Your Shortcuts\\n\\t\\t\\t\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t \",\"col\":12}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Projects Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Accounts Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Stock Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"HR Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Selling Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Buying Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Support Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Shopping Cart Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Portal Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Domain Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Products Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Naming Series\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Manufacturing Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Education Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Hotel Settings\",\"col\":3}},{\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"CRM Settings\",\"col\":3}}]",
- "creation": "2020-03-12 14:47:51.166455",
+ "creation": "2022-01-27 13:14:47.349433",
"docstatus": 0,
"doctype": "Workspace",
"for_user": "",
@@ -10,7 +10,7 @@
"idx": 0,
"label": "ERPNext Settings",
"links": [],
- "modified": "2022-01-13 19:18:59.362820",
+ "modified": "2022-04-28 11:42:01.043569",
"modified_by": "Administrator",
"module": "Setup",
"name": "ERPNext Settings",
@@ -90,20 +90,6 @@
"restrict_to_domain": "Manufacturing",
"type": "DocType"
},
- {
- "icon": "education",
- "label": "Education Settings",
- "link_to": "Education Settings",
- "restrict_to_domain": "Education",
- "type": "DocType"
- },
- {
- "icon": "organization",
- "label": "Hotel Settings",
- "link_to": "Hotel Settings",
- "restrict_to_domain": "Hospitality",
- "type": "DocType"
- },
{
"icon": "setting",
"label": "Domain Settings",
diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json
index 7ebc4eed751b..e3222bc88502 100644
--- a/erpnext/stock/doctype/delivery_note/delivery_note.json
+++ b/erpnext/stock/doctype/delivery_note/delivery_note.json
@@ -23,6 +23,10 @@
"is_return",
"issue_credit_note",
"return_against",
+ "accounting_dimensions_section",
+ "cost_center",
+ "dimension_col_break",
+ "project",
"customer_po_details",
"po_no",
"column_break_17",
@@ -115,7 +119,6 @@
"driver_name",
"lr_date",
"more_info",
- "project",
"campaign",
"source",
"column_break5",
@@ -1309,13 +1312,29 @@
"fieldtype": "Currency",
"label": "Amount Eligible for Commission",
"read_only": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "accounting_dimensions_section",
+ "fieldtype": "Section Break",
+ "label": "Accounting Dimensions"
+ },
+ {
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center"
+ },
+ {
+ "fieldname": "dimension_col_break",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-truck",
"idx": 146,
"is_submittable": 1,
"links": [],
- "modified": "2022-03-10 14:29:13.428984",
+ "modified": "2022-04-26 14:48:08.781837",
"modified_by": "Administrator",
"module": "Stock",
"name": "Delivery Note",
@@ -1380,6 +1399,7 @@
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
+ "states": [],
"timeline_field": "customer",
"title_field": "title",
"track_changes": 1,
diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json
index 06da8ee9c3e7..4f3e8429957d 100644
--- a/erpnext/stock/doctype/item/item.json
+++ b/erpnext/stock/doctype/item/item.json
@@ -869,8 +869,9 @@
},
{
"fieldname": "default_item_manufacturer",
- "fieldtype": "Data",
+ "fieldtype": "Link",
"label": "Default Item Manufacturer",
+ "options": "Manufacturer",
"read_only": 1
},
{
@@ -918,7 +919,7 @@
"image_field": "image",
"index_web_pages_for_search": 1,
"links": [],
- "modified": "2022-03-25 06:38:55.942304",
+ "modified": "2022-04-28 04:52:10.272256",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",
@@ -991,4 +992,4 @@
"states": [],
"title_field": "item_name",
"track_changes": 1
-}
+}
\ No newline at end of file
diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
index 19c490d37f16..983b62a09a49 100755
--- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
+++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json
@@ -24,6 +24,10 @@
"apply_putaway_rule",
"is_return",
"return_against",
+ "accounting_dimensions_section",
+ "cost_center",
+ "dimension_col_break",
+ "project",
"section_addresses",
"supplier_address",
"contact_person",
@@ -107,7 +111,6 @@
"bill_no",
"bill_date",
"more_info",
- "project",
"status",
"amended_from",
"range",
@@ -1143,13 +1146,29 @@
"label": "Represents Company",
"options": "Company",
"read_only": 1
+ },
+ {
+ "collapsible": 1,
+ "fieldname": "accounting_dimensions_section",
+ "fieldtype": "Section Break",
+ "label": "Accounting Dimensions"
+ },
+ {
+ "fieldname": "cost_center",
+ "fieldtype": "Link",
+ "label": "Cost Center",
+ "options": "Cost Center"
+ },
+ {
+ "fieldname": "dimension_col_break",
+ "fieldtype": "Column Break"
}
],
"icon": "fa fa-truck",
"idx": 261,
"is_submittable": 1,
"links": [],
- "modified": "2022-04-10 22:50:37.761362",
+ "modified": "2022-04-26 13:41:32.625197",
"modified_by": "Administrator",
"module": "Stock",
"name": "Purchase Receipt",
diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py
index eb0be460d8a4..236b944c3adc 100644
--- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py
+++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py
@@ -135,7 +135,7 @@ def repost(doc):
except Exception:
frappe.db.rollback()
traceback = frappe.get_traceback()
- frappe.log_error(traceback)
+ doc.log_error("Unable to repost item valuation")
message = frappe.message_log.pop() if frappe.message_log else ""
if traceback:
diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json
index c38dfaa1c844..f56e059f81c3 100644
--- a/erpnext/stock/doctype/stock_entry/stock_entry.json
+++ b/erpnext/stock/doctype/stock_entry/stock_entry.json
@@ -46,9 +46,9 @@
"items",
"get_stock_and_rate",
"section_break_19",
- "total_incoming_value",
- "column_break_22",
"total_outgoing_value",
+ "column_break_22",
+ "total_incoming_value",
"value_difference",
"additional_costs_section",
"additional_costs",
@@ -374,7 +374,7 @@
{
"fieldname": "total_incoming_value",
"fieldtype": "Currency",
- "label": "Total Incoming Value",
+ "label": "Total Incoming Value (Receipt)",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 1
@@ -386,7 +386,7 @@
{
"fieldname": "total_outgoing_value",
"fieldtype": "Currency",
- "label": "Total Outgoing Value",
+ "label": "Total Outgoing Value (Consumption)",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 1
@@ -394,7 +394,7 @@
{
"fieldname": "value_difference",
"fieldtype": "Currency",
- "label": "Total Value Difference (Out - In)",
+ "label": "Total Value Difference (Incoming - Outgoing)",
"options": "Company:company:default_currency",
"print_hide_if_no_value": 1,
"read_only": 1
@@ -619,7 +619,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
- "modified": "2022-02-07 12:55:14.614077",
+ "modified": "2022-05-02 05:21:39.060501",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Entry",
diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py
index ee151b7517ce..4763b472c239 100644
--- a/erpnext/stock/reorder_item.py
+++ b/erpnext/stock/reorder_item.py
@@ -136,14 +136,14 @@ def create_material_request(material_requests):
mr_list = []
exceptions_list = []
- def _log_exception():
+ def _log_exception(mr):
if frappe.local.message_log:
exceptions_list.extend(frappe.local.message_log)
frappe.local.message_log = []
else:
exceptions_list.append(frappe.get_traceback())
- frappe.log_error(frappe.get_traceback())
+ mr.log_error("Unable to create material request")
for request_type in material_requests:
for company in material_requests[request_type]:
@@ -207,7 +207,7 @@ def _log_exception():
mr_list.append(mr)
except Exception:
- _log_exception()
+ _log_exception(mr)
if mr_list:
if getattr(frappe.local, "reorder_email_notify", None) is None:
diff --git a/erpnext/templates/generators/student_admission.html b/erpnext/templates/generators/student_admission.html
deleted file mode 100644
index 8cc58a0a1f26..000000000000
--- a/erpnext/templates/generators/student_admission.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
-{% extends "templates/web.html" %}
-
-{% block breadcrumbs %}
- {% include "templates/includes/breadcrumbs.html" %}
-{% endblock %}
-
-{% block header %}
-
-{{ title }}
-{% endblock %}
-
-{% block page_content %}
-
-{%- if introduction -%}
-{{ introduction }}
-{% endif %}
-
-{%- if doc.enable_admission_application -%}
-
-
- {{ _("Apply Now") }}
-
-{% endif %}
-
-{% endblock %}
diff --git a/erpnext/templates/includes/assessment/assessment_row.html b/erpnext/templates/includes/assessment/assessment_row.html
deleted file mode 100644
index a33ccffc3694..000000000000
--- a/erpnext/templates/includes/assessment/assessment_row.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
- {{ doc.course }}
-
-
- {{ doc.room }}
-
-
- {{doc.schedule_date }}
-
-
- {{ doc.from_time }}
-
-
- {{ doc.to_time }}
-
-
-
diff --git a/erpnext/templates/includes/course/course_row.html b/erpnext/templates/includes/course/course_row.html
deleted file mode 100644
index fddfc3c17a8e..000000000000
--- a/erpnext/templates/includes/course/course_row.html
+++ /dev/null
@@ -1,18 +0,0 @@
-
diff --git a/erpnext/templates/includes/course/macros.html b/erpnext/templates/includes/course/macros.html
deleted file mode 100644
index 334b5ea200a6..000000000000
--- a/erpnext/templates/includes/course/macros.html
+++ /dev/null
@@ -1 +0,0 @@
-{% macro back_link(doc) %}&back-to=/courses?course={{ doc.name }}&back-to-title={{ doc.course_name }}{% endmacro %}
diff --git a/erpnext/templates/pages/integrations/gocardless_checkout.py b/erpnext/templates/pages/integrations/gocardless_checkout.py
index 280f67f16b90..655be52c55c7 100644
--- a/erpnext/templates/pages/integrations/gocardless_checkout.py
+++ b/erpnext/templates/pages/integrations/gocardless_checkout.py
@@ -96,5 +96,5 @@ def check_mandate(data, reference_doctype, reference_docname):
return {"redirect_to": redirect_flow.redirect_url}
except Exception as e:
- frappe.log_error(e, "GoCardless Payment Error")
+ frappe.log_error("GoCardless Payment Error")
return {"redirect_to": "/integrations/payment-failed"}
diff --git a/erpnext/templates/pages/integrations/gocardless_confirmation.py b/erpnext/templates/pages/integrations/gocardless_confirmation.py
index cab532a53037..559aa4806d93 100644
--- a/erpnext/templates/pages/integrations/gocardless_confirmation.py
+++ b/erpnext/templates/pages/integrations/gocardless_confirmation.py
@@ -60,7 +60,7 @@ def confirm_payment(redirect_flow_id, reference_doctype, reference_docname):
try:
create_mandate(data)
except Exception as e:
- frappe.log_error(e, "GoCardless Mandate Registration Error")
+ frappe.log_error("GoCardless Mandate Registration Error")
gateway_controller = get_gateway_controller(reference_docname)
frappe.get_doc("GoCardless Settings", gateway_controller).create_payment_request(data)
@@ -68,7 +68,7 @@ def confirm_payment(redirect_flow_id, reference_doctype, reference_docname):
return {"redirect_to": confirmation_url}
except Exception as e:
- frappe.log_error(e, "GoCardless Payment Error")
+ frappe.log_error("GoCardless Payment Error")
return {"redirect_to": "/integrations/payment-failed"}
@@ -103,4 +103,4 @@ def create_mandate(data):
).insert(ignore_permissions=True)
except Exception:
- frappe.log_error(frappe.get_traceback())
+ frappe.log_error("Gocardless: Unable to create mandate")
diff --git a/erpnext/tests/server/agriculture.txt b/erpnext/tests/server/agriculture.txt
deleted file mode 100644
index 29dc9ab62de8..000000000000
--- a/erpnext/tests/server/agriculture.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-Disease
-Crop
-Crop Cycle
-Soil Texture
\ No newline at end of file
diff --git a/erpnext/tests/test_woocommerce.py b/erpnext/tests/test_woocommerce.py
deleted file mode 100644
index 663464b6b789..000000000000
--- a/erpnext/tests/test_woocommerce.py
+++ /dev/null
@@ -1,152 +0,0 @@
-import os
-import time
-import unittest
-
-import frappe
-import requests
-
-from erpnext.erpnext_integrations.connectors.woocommerce_connection import order
-
-
-class TestWoocommerce(unittest.TestCase):
- def setUp(self):
-
- woo_settings = frappe.get_doc("Woocommerce Settings")
- if not woo_settings.secret:
- woo_settings.secret = "ec434676aa1de0e502389f515c38f89f653119ab35e9117c7a79e576"
- woo_settings.woocommerce_server_url = "https://woocommerce.mntechnique.com/"
- woo_settings.api_consumer_key = "ck_fd43ff5756a6abafd95fadb6677100ce95a758a1"
- woo_settings.api_consumer_secret = "cs_94360a1ad7bef7fa420a40cf284f7b3e0788454e"
- woo_settings.enable_sync = 1
- woo_settings.company = "_Test Company"
- woo_settings.tax_account = "Sales Expenses - _TC"
- woo_settings.f_n_f_account = "Expenses - _TC"
- woo_settings.creation_user = "Administrator"
- woo_settings.save(ignore_permissions=True)
-
- def test_sales_order_for_woocommerce(self):
- frappe.flags.woocomm_test_order_data = {
- "id": 75,
- "parent_id": 0,
- "number": "74",
- "order_key": "wc_order_5aa1281c2dacb",
- "created_via": "checkout",
- "version": "3.3.3",
- "status": "processing",
- "currency": "INR",
- "date_created": "2018-03-08T12:10:04",
- "date_created_gmt": "2018-03-08T12:10:04",
- "date_modified": "2018-03-08T12:10:04",
- "date_modified_gmt": "2018-03-08T12:10:04",
- "discount_total": "0.00",
- "discount_tax": "0.00",
- "shipping_total": "150.00",
- "shipping_tax": "0.00",
- "cart_tax": "0.00",
- "total": "649.00",
- "total_tax": "0.00",
- "prices_include_tax": False,
- "customer_id": 12,
- "customer_ip_address": "103.54.99.5",
- "customer_user_agent": "mozilla\\/5.0 (x11; linux x86_64) applewebkit\\/537.36 (khtml, like gecko) chrome\\/64.0.3282.186 safari\\/537.36",
- "customer_note": "",
- "billing": {
- "first_name": "Tony",
- "last_name": "Stark",
- "company": "_Test Company",
- "address_1": "Mumbai",
- "address_2": "",
- "city": "Dadar",
- "state": "MH",
- "postcode": "123",
- "country": "IN",
- "email": "tony@gmail.com",
- "phone": "123457890",
- },
- "shipping": {
- "first_name": "Tony",
- "last_name": "Stark",
- "company": "",
- "address_1": "Mumbai",
- "address_2": "",
- "city": "Dadar",
- "state": "MH",
- "postcode": "123",
- "country": "IN",
- },
- "payment_method": "cod",
- "payment_method_title": "Cash on delivery",
- "transaction_id": "",
- "date_paid": "",
- "date_paid_gmt": "",
- "date_completed": "",
- "date_completed_gmt": "",
- "cart_hash": "8e76b020d5790066496f244860c4703f",
- "meta_data": [],
- "line_items": [
- {
- "id": 80,
- "name": "Marvel",
- "product_id": 56,
- "variation_id": 0,
- "quantity": 1,
- "tax_class": "",
- "subtotal": "499.00",
- "subtotal_tax": "0.00",
- "total": "499.00",
- "total_tax": "0.00",
- "taxes": [],
- "meta_data": [],
- "sku": "",
- "price": 499,
- }
- ],
- "tax_lines": [],
- "shipping_lines": [
- {
- "id": 81,
- "method_title": "Flat rate",
- "method_id": "flat_rate:1",
- "total": "150.00",
- "total_tax": "0.00",
- "taxes": [],
- "meta_data": [{"id": 623, "key": "Items", "value": "Marvel × 1"}],
- }
- ],
- "fee_lines": [],
- "coupon_lines": [],
- "refunds": [],
- }
- order()
-
- self.assertTrue(frappe.get_value("Customer", {"woocommerce_email": "tony@gmail.com"}))
- self.assertTrue(frappe.get_value("Item", {"woocommerce_id": 56}))
- self.assertTrue(frappe.get_value("Sales Order", {"woocommerce_id": 75}))
- frappe.flags.woocomm_test_order_data = {}
-
-
-def emulate_request():
- # Emulate Woocommerce Request
- headers = {
- "X-Wc-Webhook-Event": "created",
- "X-Wc-Webhook-Signature": "h1SjzQMPwd68MF5bficeFq20/RkQeRLsb9AVCUz/rLs=",
- }
- # Emulate Request Data
- data = """{"id":74,"parent_id":0,"number":"74","order_key":"wc_order_5aa1281c2dacb","created_via":"checkout","version":"3.3.3","status":"processing","currency":"INR","date_created":"2018-03-08T12:10:04","date_created_gmt":"2018-03-08T12:10:04","date_modified":"2018-03-08T12:10:04","date_modified_gmt":"2018-03-08T12:10:04","discount_total":"0.00","discount_tax":"0.00","shipping_total":"150.00","shipping_tax":"0.00","cart_tax":"0.00","total":"649.00","total_tax":"0.00","prices_include_tax":false,"customer_id":12,"customer_ip_address":"103.54.99.5","customer_user_agent":"mozilla\\/5.0 (x11; linux x86_64) applewebkit\\/537.36 (khtml, like gecko) chrome\\/64.0.3282.186 safari\\/537.36","customer_note":"","billing":{"first_name":"Tony","last_name":"Stark","company":"Woocommerce","address_1":"Mumbai","address_2":"","city":"Dadar","state":"MH","postcode":"123","country":"IN","email":"tony@gmail.com","phone":"123457890"},"shipping":{"first_name":"Tony","last_name":"Stark","company":"","address_1":"Mumbai","address_2":"","city":"Dadar","state":"MH","postcode":"123","country":"IN"},"payment_method":"cod","payment_method_title":"Cash on delivery","transaction_id":"","date_paid":null,"date_paid_gmt":null,"date_completed":null,"date_completed_gmt":null,"cart_hash":"8e76b020d5790066496f244860c4703f","meta_data":[],"line_items":[{"id":80,"name":"Marvel","product_id":56,"variation_id":0,"quantity":1,"tax_class":"","subtotal":"499.00","subtotal_tax":"0.00","total":"499.00","total_tax":"0.00","taxes":[],"meta_data":[],"sku":"","price":499}],"tax_lines":[],"shipping_lines":[{"id":81,"method_title":"Flat rate","method_id":"flat_rate:1","total":"150.00","total_tax":"0.00","taxes":[],"meta_data":[{"id":623,"key":"Items","value":"Marvel × 1"}]}],"fee_lines":[],"coupon_lines":[],"refunds":[]}"""
-
- # Build URL
- port = frappe.get_site_config().webserver_port or "8000"
-
- if os.environ.get("CI"):
- host = "localhost"
- else:
- host = frappe.local.site
-
- url = "http://{site}:{port}/api/method/erpnext.erpnext_integrations.connectors.woocommerce_connection.order".format(
- site=host, port=port
- )
-
- r = requests.post(url=url, headers=headers, data=data)
-
- time.sleep(5)
- return r
diff --git a/erpnext/tests/ui/agriculture.txt b/erpnext/tests/ui/agriculture.txt
deleted file mode 100644
index 4622bc0df353..000000000000
--- a/erpnext/tests/ui/agriculture.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-erpnext/agriculture/doctype/land_unit/test_land_unit.js
-erpnext/agriculture/doctype/fertilizer/test_fertilizer.js
-erpnext/agriculture/doctype/water_analysis/test_water_analysis.js
-erpnext/agriculture/doctype/disease/test_disease.js
-erpnext/agriculture/doctype/soil_texture/test_soil_texture.js
-erpnext/agriculture/doctype/crop/test_crop.js
-erpnext/agriculture/doctype/crop_cycle/test_crop_cycle.js
\ No newline at end of file
diff --git a/erpnext/tests/ui/make_fixtures.js b/erpnext/tests/ui/make_fixtures.js
deleted file mode 100644
index 8c9e50884af1..000000000000
--- a/erpnext/tests/ui/make_fixtures.js
+++ /dev/null
@@ -1,258 +0,0 @@
-$.extend(frappe.test_data, {
- // "Fiscal Year": {
- // "2017-18": [
- // {"year": "2017-18"},
- // {"year_start_date": "2017-04-01"},
- // {"year_end_date": "2018-03-31"},
- // ]
- // },
- "Customer": {
- "Test Customer 1": [
- {customer_name: "Test Customer 1"}
- ],
- "Test Customer 2": [
- {customer_name: "Test Customer 2"}
- ],
- "Test Customer 3": [
- {customer_name: "Test Customer 3"}
- ],
- },
- "Item": {
- "Test Product 1": [
- {item_code: "Test Product 1"},
- {item_group: "Products"},
- {is_stock_item: 1},
- {standard_rate: 100},
- {opening_stock: 100},
- ],
- "Test Product 2": [
- {item_code: "Test Product 2"},
- {item_group: "Products"},
- {is_stock_item: 1},
- {standard_rate: 150},
- {opening_stock: 200},
- ],
- "Test Product 3": [
- {item_code: "Test Product 3"},
- {item_group: "Products"},
- {is_stock_item: 1},
- {standard_rate: 250},
- {opening_stock: 100},
- {stock_uom:'Kg'}
- ],
- "Test Service 1": [
- {item_code: "Test Service 1"},
- {item_group: "Services"},
- {is_stock_item: 0},
- {standard_rate: 200}
- ],
- "Test Service 2": [
- {item_code: "Test Service 2"},
- {item_group: "Services"},
- {is_stock_item: 0},
- {standard_rate: 300}
- ]
- },
- "Lead": {
- "LEAD-00001": [
- {lead_name: "Test Lead 1"}
- ],
- "LEAD-00002": [
- {lead_name: "Test Lead 2"}
- ],
- "LEAD-00003": [
- {lead_name: "Test Lead 3"}
- ]
- },
- "Address": {
- "Test1-Billing": [
- {address_title:"Test1"},
- {address_type: "Billing"},
- {address_line1: "Billing Street 1"},
- {city: "Billing City 1"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 1"}
- ]
- ]}
- ],
- "Test1-Shipping": [
- {address_title:"Test1"},
- {address_type: "Shipping"},
- {address_line1: "Shipping Street 1"},
- {city: "Shipping City 1"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 1"}
- ]
- ]}
- ],
- "Test1-Warehouse": [
- {address_title:"Test1"},
- {address_type: "Warehouse"},
- {address_line1: "Warehouse Street 1"},
- {city: "Warehouse City 1"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 1"}
- ]
- ]}
- ],
- "Test2-Billing": [
- {address_title:"Test2"},
- {address_type: "Billing"},
- {address_line1: "Billing Street 2"},
- {city: "Billing City 2"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 2"}
- ]
- ]}
- ],
- "Test2-Shipping": [
- {address_title:"Test2"},
- {address_type: "Shipping"},
- {address_line1: "Shipping Street 2"},
- {city: "Shipping City 2"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 2"}
- ]
- ]}
- ],
- "Test2-Warehouse": [
- {address_title:"Test2"},
- {address_type: "Warehouse"},
- {address_line1: "Warehouse Street 2"},
- {city: "Warehouse City 2"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 2"}
- ]
- ]}
- ]
- },
- "Contact": {
- "Contact 1-Test Customer 1": [
- {first_name: "Contact 1"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 1"}
- ]
- ]}
- ],
- "Contact 2-Test Customer 1": [
- {first_name: "Contact 2"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 1"}
- ]
- ]}
- ],
- "Contact 1-Test Customer 2": [
- {first_name: "Contact 1"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 2"}
- ]
- ]}
- ],
- "Contact 2-Test Customer 2": [
- {first_name: "Contact 2"},
- {links: [
- [
- {link_doctype: "Customer"},
- {link_name: "Test Customer 2"}
- ]
- ]}
- ],
- },
- "Price List": {
- "Test-Buying-USD": [
- {price_list_name: "Test-Buying-USD"},
- {currency: "USD"},
- {buying: "1"}
- ],
- "Test-Buying-EUR": [
- {price_list_name: "Test-Buying-EUR"},
- {currency: "EUR"},
- {buying: "1"}
- ],
- "Test-Selling-USD": [
- {price_list_name: "Test-Selling-USD"},
- {currency: "USD"},
- {selling: "1"}
- ],
- "Test-Selling-EUR": [
- {price_list_name: "Test-Selling-EUR"},
- {currency: "EUR"},
- {selling: "1"}
- ],
- },
- "Terms and Conditions": {
- "Test Term 1": [
- {title: "Test Term 1"}
- ],
- "Test Term 2": [
- {title: "Test Term 2"}
- ]
- },
- "Item Price": {
- "ITEM-PRICE-00001": [
- {item_code: 'Test Product 1'},
- {price_list: '_Test Price List'},
- {price_list_rate: 100}
- ],
- "ITEM-PRICE-00002": [
- {item_code: 'Test Product 2'},
- {price_list: '_Test Price List'},
- {price_list_rate: 200}
- ]
- },
- "Payment Term": {
- "_Test Payment Term": [
- {payment_term_name: '_Test Payment Term'},
- {due_date_based_on: 'Day(s) after invoice date'},
- {invoice_portion: 100},
- {credit_days: 0}
- ]
- },
- "Payment Terms Template": {
- "_Test Payment Term Template UI": [
- {template_name: "_Test Payment Term Template UI"},
- {terms: [
- [
- {payment_term: '_Test Payment Term'},
- {invoice_portion: 100}
- ]
- ]}
- ]
- }
-});
-
-
-// this is a script that creates all fixtures
-// called as a test
-QUnit.module('fixture');
-
-QUnit.test('Make fixtures', assert => {
- // create all fixtures first
- assert.expect(0);
- let done = assert.async();
- let tasks = [];
- Object.keys(frappe.test_data).forEach(function(doctype) {
- tasks.push(function() {
- return frappe.tests.setup_doctype(doctype, frappe.test_data[doctype]);
- });
- });
- frappe.run_serially(tasks).then(() => done());
-});
diff --git a/erpnext/tests/ui/setup_wizard.js b/erpnext/tests/ui/setup_wizard.js
deleted file mode 100644
index ccff785ec948..000000000000
--- a/erpnext/tests/ui/setup_wizard.js
+++ /dev/null
@@ -1,47 +0,0 @@
-const path = require('path');
-const path_join = path.resolve;
-const apps_path = path_join(__dirname, '..', '..', '..', '..');
-const frappe_ui_tests_path = path_join(apps_path, 'frappe', 'frappe', 'tests', 'ui');
-
-const login = require(frappe_ui_tests_path + "/login.js")['Login'];
-const welcome = require(frappe_ui_tests_path + "/setup_wizard.js")['Welcome'];
-const region = require(frappe_ui_tests_path + "/setup_wizard.js")['Region'];
-const user = require(frappe_ui_tests_path + "/setup_wizard.js")['User'];
-
-module.exports = {
- before: browser => {
- browser
- .url(browser.launch_url + '/login')
- .waitForElementVisible('body', 5000);
- },
- 'Login': login,
- 'Welcome': welcome,
- 'Region': region,
- 'User': user,
- 'Domain': browser => {
- let slide_selector = '[data-slide-name="domain"]';
- browser
- .waitForElementVisible(slide_selector, 2000)
- .setValue('select[data-fieldname="domain"]', "Manufacturing")
- .click(slide_selector + ' .next-btn');
- },
- 'Brand': browser => {
- let slide_selector = '[data-slide-name="brand"]';
- browser
- .waitForElementVisible(slide_selector, 2000)
- .setValue('input[data-fieldname="company_name"]', "Acme")
- .click(slide_selector + " .next-btn");
- },
- 'Organisation': browser => {
- let slide_selector = '[data-slide-name="organisation"]';
- browser
- .waitForElementVisible(slide_selector, 2000)
- .setValue('input[data-fieldname="company_tagline"]', "Build tools for Builders")
- .setValue('input[data-fieldname="bank_account"]', "YNG")
- .click(slide_selector + " .next-btn");
- },
-
- after: browser => {
- browser.end();
- },
-};
diff --git a/erpnext/tests/ui/tests.txt b/erpnext/tests/ui/tests.txt
deleted file mode 100644
index 5e238e449ee3..000000000000
--- a/erpnext/tests/ui/tests.txt
+++ /dev/null
@@ -1,110 +0,0 @@
-erpnext/tests/ui/make_fixtures.js #long
-erpnext/accounts/doctype/account/tests/test_account.js
-erpnext/accounts/doctype/account/tests/test_make_tax_account.js
-erpnext/accounts/doctype/account/tests/test_account_with_number.js
-erpnext/accounts/doctype/pricing_rule/tests/test_pricing_rule.js
-erpnext/accounts/doctype/sales_taxes_and_charges_template/test_sales_taxes_and_charges_template.js
-erpnext/accounts/doctype/purchase_taxes_and_charges_template/test_purchase_taxes_and_charges_template.js
-erpnext/accounts/doctype/shipping_rule/test_shipping_rule.js
-erpnext/crm/doctype/opportunity/test_opportunity.js
-erpnext/stock/doctype/item/tests/test_item.js
-erpnext/selling/doctype/quotation/tests/test_quotation_with_discount_on_grand_total.js
-erpnext/selling/doctype/quotation/tests/test_quotation_with_item_wise_discount.js
-erpnext/selling/doctype/quotation/tests/test_quotation_with_multi_uom.js
-erpnext/selling/doctype/quotation/tests/test_quotation_with_taxes_and_charges.js
-erpnext/selling/doctype/quotation/tests/test_quotation_with_shipping_rule.js
-erpnext/selling/doctype/quotation/tests/test_quotation.js
-erpnext/selling/doctype/sales_order/tests/test_sales_order.js
-erpnext/selling/doctype/sales_order/tests/test_sales_order_with_multiple_delivery_date.js
-erpnext/selling/doctype/sales_order/tests/test_sales_order_with_item_wise_discount.js
-erpnext/selling/doctype/sales_order/tests/test_sales_order_with_multi_uom.js
-erpnext/selling/doctype/sales_order/tests/test_sales_order_with_discount_on_grand_total.js
-erpnext/selling/doctype/sales_order/tests/test_sales_order_with_taxes_and_charges.js
-erpnext/selling/doctype/sales_order/tests/test_sales_order_with_shipping_rule.js
-erpnext/selling/doctype/sales_order/tests/test_sales_order_with_pricing_rule.js
-erpnext/manufacturing/doctype/workstation/test_workstation.js
-erpnext/manufacturing/doctype/operation/test_operation.js
-erpnext/manufacturing/doctype/bom/test_bom.js
-erpnext/projects/doctype/project/project_timesheet.js
-erpnext/hr/doctype/holiday_list/test_holiday_list.js
-erpnext/hr/doctype/branch/test_branch.js
-erpnext/hr/doctype/leave_block_list/test_leave_block_list.js
-erpnext/hr/doctype/department/test_department.js
-erpnext/hr/doctype/designation/test_designation.js
-erpnext/hr/doctype/employment_type/test_employment_type.js
-erpnext/hr/doctype/employee/test_employee.js
-erpnext/hr/doctype/employee_attendance_tool/test_employee_attendance_tool.js
-erpnext/hr/doctype/attendance/test_attendance.js
-erpnext/hr/doctype/leave_type/test_leave_type.js
-erpnext/hr/doctype/leave_control_panel/test_leave_control_panel.js
-erpnext/hr/doctype/leave_allocation/test_leave_allocation.js
-erpnext/hr/doctype/leave_application/test_leave_application.js
-erpnext/stock/doctype/warehouse/test_warehouse.js
-erpnext/manufacturing/doctype/work_order/test_work_order.js #long
-erpnext/accounts/page/pos/test_pos.js
-erpnext/selling/page/point_of_sale/tests/test_point_of_sale.js
-erpnext/selling/doctype/product_bundle/test_product_bundle.js
-erpnext/stock/doctype/delivery_note/test_delivery_note.js
-erpnext/stock/doctype/material_request/tests/test_material_request.js
-erpnext/stock/doctype/material_request/tests/test_material_request_type_material_issue.js
-erpnext/stock/doctype/material_request/tests/test_material_request_type_material_transfer.js
-erpnext/stock/doctype/material_request/tests/test_material_request_type_manufacture.js
-erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_issue.js
-erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt.js
-erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_transfer.js
-erpnext/hr/doctype/salary_structure/test_salary_structure.js
-erpnext/hr/doctype/salary_slip/test_salary_slip.js
-erpnext/hr/doctype/job_opening/test_job_opening.js
-erpnext/hr/doctype/job_applicant/test_job_applicant.js
-erpnext/hr/doctype/job_offer/test_job_offer.js
-erpnext/hr/doctype/appraisal_template/test_appraisal_template.js
-erpnext/hr/doctype/appraisal/test_appraisal.js
-erpnext/hr/doctype/expense_claim_type/test_expense_claim_type.js
-erpnext/hr/doctype/expense_claim/test_expense_claim.js
-erpnext/hr/doctype/training_event/tests/test_training_event.js
-erpnext/hr/doctype/training_result_employee/test_training_result.js
-erpnext/hr/doctype/training_feedback/test_training_feedback.js
-erpnext/hr/doctype/loan_type/test_loan_type.js
-erpnext/hr/doctype/loan_application/test_loan_application.js
-erpnext/hr/doctype/loan/test_loan.js
-erpnext/buying/doctype/supplier/test_supplier.js
-erpnext/buying/doctype/request_for_quotation/tests/test_request_for_quotation.js
-erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation.js
-erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation_for_taxes_and_charges.js
-erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice.js
-erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment.js
-erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_payment_request.js
-erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.js
-erpnext/accounts/doctype/payment_entry/tests/test_payment_against_purchase_invoice.js
-erpnext/buying/doctype/supplier_quotation/tests/test_supplier_quotation_for_item_wise_discount.js
-erpnext/buying/doctype/purchase_order/tests/test_purchase_order.js
-erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_multi_uom.js
-erpnext/buying/doctype/purchase_order/tests/test_purchase_order_get_items.js
-erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_discount_on_grand_total.js
-erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_item_wise_discount.js
-erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_taxes_and_charges.js
-erpnext/buying/doctype/purchase_order/tests/test_purchase_order_receipt.js
-erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.js
-erpnext/accounts/doctype/journal_entry/test_journal_entry.js
-erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.js
-erpnext/accounts/doctype/payment_entry/tests/test_payment_entry.js
-erpnext/selling/doctype/quotation/tests/test_quotation_submit_cancel_amend.js
-erpnext/stock/doctype/batch/test_batch.js
-erpnext/accounts/doctype/bank_reconciliation/test_bank_reconciliation.js
-erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_receipt_for_serialize_item.js
-erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_transfer_for_manufacture.js
-erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_subcontract.js
-erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_material_issue_with_serialize_item.js
-erpnext/stock/doctype/stock_entry/tests/test_stock_entry_for_repack.js
-erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_serialize_item.js
-erpnext/accounts/doctype/payment_entry/tests/test_payment_against_invoice.js
-erpnext/buying/doctype/purchase_order/tests/test_purchase_order_with_last_purchase_rate.js
-erpnext/stock/doctype/item_price/test_item_price.js
-erpnext/stock/doctype/delivery_note/test_delivery_note_with_margin.js
-erpnext/selling/doctype/sales_order/tests/test_sales_order_with_margin.js
-erpnext/selling/doctype/quotation/tests/test_quotation_with_margin.js
-erpnext/accounts/doctype/sales_invoice/tests/test_sales_invoice_with_margin.js
-erpnext/hr/doctype/payroll_entry/test_set_salary_components.js
-erpnext/hr/doctype/payroll_entry/test_payroll_entry.js
-erpnext/accounts/doctype/pricing_rule/tests/test_pricing_rule_with_same_currency.js
-erpnext/accounts/doctype/pricing_rule/tests/test_pricing_rule_with_different_currency.js
\ No newline at end of file
diff --git a/erpnext/tests/ui/tests2.txt b/erpnext/tests/ui/tests2.txt
deleted file mode 100644
index e410a83b2e4f..000000000000
--- a/erpnext/tests/ui/tests2.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-erpnext/setup/doctype/company/tests/test_company.js
-erpnext/crm/doctype/lead/tests/test_lead_individual.js
-erpnext/crm/doctype/lead/tests/test_lead_organization.js
-erpnext/setup/doctype/company/tests/test_company_production.js
-erpnext/hr/doctype/leave_block_list/test_leave_block_list.js
-erpnext/hr/doctype/department/test_department.js
-erpnext/hr/doctype/designation/test_designation.js
-erpnext/education/doctype/academic_year/test_academic_year.js
-erpnext/education/doctype/academic_term/test_academic_term.js
-erpnext/education/doctype/education_settings/test_education_settings.js
-erpnext/education/doctype/student_batch_name/test_student_batch_name.js
-erpnext/education/doctype/student_category/test_student_category.js
-erpnext/education/doctype/room/test_room.js
-erpnext/education/doctype/instructor/test_instructor.js
-erpnext/education/doctype/grading_scale/test_grading_scale.js
-erpnext/education/doctype/assessment_criteria_group/test_assessment_criteria_group.js
-erpnext/education/doctype/assessment_criteria/test_assessment_criteria.js
-erpnext/education/doctype/course/test_course.js
-erpnext/education/doctype/program/test_program.js
-erpnext/education/doctype/guardian/test_guardian.js
-erpnext/education/doctype/student_admission/test_student_admission.js
-erpnext/education/doctype/student_applicant/tests/test_student_applicant_dummy_data.js
-erpnext/education/doctype/student_applicant/tests/test_student_applicant.js
-erpnext/education/doctype/student_applicant/tests/test_student_applicant_options.js
-erpnext/education/doctype/student_log/test_student_log.js
-erpnext/education/doctype/student_group/test_student_group.js
-erpnext/education/doctype/student_group_creation_tool/test_student_group_creation_tool.js
-erpnext/education/doctype/student_leave_application/test_student_leave_application.js
-erpnext/education/doctype/student_attendance_tool/test_student_attendance_tool.js
-erpnext/education/doctype/student_attendance/test_student_attendance.js
-erpnext/education/doctype/assessment_group/test_assessment_group.js
-erpnext/education/doctype/assessment_plan/test_assessment_plan.js
-erpnext/education/doctype/assessment_result/test_assessment_result.js
-erpnext/education/doctype/assessment_result_tool/test_assessment_result_tool.js
-erpnext/projects/doctype/task/tests/test_task_tree.js
-erpnext/restaurant/doctype/restaurant/test_restaurant.js
-erpnext/restaurant/doctype/restaurant_table/test_restaurant_table.js
-erpnext/restaurant/doctype/restaurant_menu/test_restaurant_menu.js
-erpnext/restaurant/doctype/restaurant_order_entry/restaurant_order_entry.js
-erpnext/non_profit/doctype/membership_type/test_membership_type.js
-erpnext/non_profit/doctype/member/test_member.js
-erpnext/non_profit/doctype/volunteer_type/test_volunteer_type.js
-erpnext/non_profit/doctype/volunteer/test_volunteer.js
-erpnext/non_profit/doctype/donor_type/test_donor_type.js
-erpnext/non_profit/doctype/donor/test_donor.js
-erpnext/non_profit/doctype/grant_application/test_grant_application.js
\ No newline at end of file
diff --git a/erpnext/tests/ui_test_bulk_transaction_processing.py b/erpnext/tests/ui_test_bulk_transaction_processing.py
deleted file mode 100644
index a0dc76d54f5b..000000000000
--- a/erpnext/tests/ui_test_bulk_transaction_processing.py
+++ /dev/null
@@ -1,21 +0,0 @@
-import frappe
-
-from erpnext.bulk_transaction.doctype.bulk_transaction_logger.test_bulk_transaction_logger import (
- create_company,
- create_customer,
- create_item,
- create_so,
-)
-
-
-@frappe.whitelist()
-def create_records():
- create_company()
- create_customer()
- create_item()
-
- gd = frappe.get_doc("Global Defaults")
- gd.set("default_company", "Test Bulk")
- gd.save()
- frappe.clear_cache()
- create_so()
diff --git a/erpnext/tests/ui_test_helpers.py b/erpnext/tests/ui_test_helpers.py
deleted file mode 100644
index 44834c8a77c8..000000000000
--- a/erpnext/tests/ui_test_helpers.py
+++ /dev/null
@@ -1,75 +0,0 @@
-import frappe
-from frappe.utils import getdate
-
-
-@frappe.whitelist()
-def create_employee_records():
- create_company()
- create_missing_designation()
-
- frappe.db.sql("DELETE FROM tabEmployee WHERE company='Test Org Chart'")
-
- emp1 = create_employee("Test Employee 1", "CEO")
- emp2 = create_employee("Test Employee 2", "CTO")
- emp3 = create_employee("Test Employee 3", "Head of Marketing and Sales", emp1)
- emp4 = create_employee("Test Employee 4", "Project Manager", emp2)
- emp5 = create_employee("Test Employee 5", "Engineer", emp2)
- emp6 = create_employee("Test Employee 6", "Analyst", emp3)
- emp7 = create_employee("Test Employee 7", "Software Developer", emp4)
-
- employees = [emp1, emp2, emp3, emp4, emp5, emp6, emp7]
- return employees
-
-
-@frappe.whitelist()
-def get_employee_records():
- return frappe.db.get_list(
- "Employee", filters={"company": "Test Org Chart"}, pluck="name", order_by="name"
- )
-
-
-def create_company():
- company = frappe.db.exists("Company", "Test Org Chart")
- if not company:
- company = (
- frappe.get_doc(
- {
- "doctype": "Company",
- "company_name": "Test Org Chart",
- "country": "India",
- "default_currency": "INR",
- }
- )
- .insert()
- .name
- )
-
- return company
-
-
-def create_employee(first_name, designation, reports_to=None):
- employee = frappe.db.exists("Employee", {"first_name": first_name, "designation": designation})
- if not employee:
- employee = (
- frappe.get_doc(
- {
- "doctype": "Employee",
- "first_name": first_name,
- "company": "Test Org Chart",
- "gender": "Female",
- "date_of_birth": getdate("08-12-1998"),
- "date_of_joining": getdate("01-01-2021"),
- "designation": designation,
- "reports_to": reports_to,
- }
- )
- .insert()
- .name
- )
-
- return employee
-
-
-def create_missing_designation():
- if not frappe.db.exists("Designation", "CTO"):
- frappe.get_doc({"doctype": "Designation", "designation_name": "CTO"}).insert()
diff --git a/erpnext/utilities/activation.py b/erpnext/utilities/activation.py
index 43af0dc3c1b7..cd7910ce4386 100644
--- a/erpnext/utilities/activation.py
+++ b/erpnext/utilities/activation.py
@@ -37,7 +37,6 @@ def get_level():
"Sales Order": 2,
"Sales Invoice": 2,
"Stock Entry": 3,
- "Student": 5,
"Supplier": 5,
"Task": 5,
"User": 5,
@@ -136,24 +135,6 @@ def get_help_messages():
domain=("Services",),
target=5,
),
- frappe._dict(
- doctype="Student",
- title=_("Add Students"),
- description=_("Students are at the heart of the system, add all your students"),
- action=_("Create Student"),
- route="List/Student",
- domain=("Education",),
- target=5,
- ),
- frappe._dict(
- doctype="Student Batch",
- title=_("Group your students in batches"),
- description=_("Student Batches help you track attendance, assessments and fees for students"),
- action=_("Create Student Batch"),
- route="List/Student Batch",
- domain=("Education",),
- target=3,
- ),
frappe._dict(
doctype="Employee",
title=_("Create Employee Records"),
diff --git a/erpnext/utilities/doctype/video/video.py b/erpnext/utilities/doctype/video/video.py
index 330812dc2757..a39d0a95ebf1 100644
--- a/erpnext/utilities/doctype/video/video.py
+++ b/erpnext/utilities/doctype/video/video.py
@@ -36,8 +36,7 @@ def set_youtube_statistics(self):
self.comment_count = video_stats.get("commentCount")
except Exception:
- title = "Failed to Update YouTube Statistics for Video: {0}".format(self.name)
- frappe.log_error(title + "\n\n" + frappe.get_traceback(), title=title)
+ self.log_error("Unable to update YouTube statistics")
def is_tracking_enabled():
@@ -109,8 +108,7 @@ def get_youtube_statistics(video_ids):
video_stats = video.items
return video_stats
except Exception:
- title = "Failed to Update YouTube Statistics"
- frappe.log_error(title + "\n\n" + frappe.get_traceback(), title=title)
+ frappe.log_error("Unable to update YouTube statistics")
def prepare_and_set_data(video_list):
video_ids = get_formatted_ids(video_list)
diff --git a/erpnext/utilities/doctype/video_settings/video_settings.py b/erpnext/utilities/doctype/video_settings/video_settings.py
index 97fbc41934b6..9bc7972bb37a 100644
--- a/erpnext/utilities/doctype/video_settings/video_settings.py
+++ b/erpnext/utilities/doctype/video_settings/video_settings.py
@@ -18,5 +18,5 @@ def validate_youtube_api_key(self):
build("youtube", "v3", developerKey=self.api_key)
except Exception:
title = _("Failed to Authenticate the API key.")
- frappe.log_error(title + "\n\n" + frappe.get_traceback(), title=title)
+ self.log_error("Failed to authenticate API key")
frappe.throw(title + " Please check the error logs.", title=_("Invalid Credentials"))
diff --git a/erpnext/www/lms/__init__.py b/erpnext/www/lms/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/www/lms/content.html b/erpnext/www/lms/content.html
deleted file mode 100644
index d22ef66d2a8f..000000000000
--- a/erpnext/www/lms/content.html
+++ /dev/null
@@ -1,246 +0,0 @@
-{% extends "templates/base.html" %}
-{% block title %}{{ content.name or 'Content Page' }}{% endblock %}
-
-{% block head_include %}
-
-
-{% endblock %}
-
-{% macro title() %}
-
-
-
{{ content.name }} ({{ position + 1 }}/{{length}})
-
-
-{% endmacro %}
-
-{% macro navigation() %}
- {% if previous %}
- {{_('Previous')}}
- {% else %}
- {{ _('Back to Course') }}
- {% endif %}
-
- {% if next %}
- {{_('Next')}}
- {% else %}
- {{_('Finish Topic')}}
- {% endif %}
-{% endmacro %}
-
-{% macro video() %}
-
- {{ title() }}
-
- {% if content.duration %}
- {{ content.duration }} {{_('Mins')}}
- {% endif %}
-
- {% if content.publish_date and content.duration%}
- -
- {% endif %}
-
- {% if content.publish_date %}
- {{_('Published on')}} {{ content.publish_date.strftime('%d, %b %Y') }}
- {% endif %}
-
-
-
-
- {{ content.description }}
-
-{% endmacro %}
-
-{% macro article() %}
-
- {{ title() }}
-
- {% if content.author or content.publish_date %}
- {{_('Published')}}
- {% endif %}
- {% if content.author %}
- {{_('by')}} {{ content.author }}
- {% endif %}
- {% if content.publish_date %}
- {{_('on')}} {{ content.publish_date.strftime('%d, %b %Y') }}
- {% endif %}
-
-
-
- {{ content.content }}
-
-{% endmacro %}
-
-{% macro quiz() %}
-
- {{ title() }}
-
-
-
-{% endmacro %}
-
-{% block content %}
-
-
-
- {% if content_type=='Video' %}
- {{ video() }}
- {% elif content_type=='Article'%}
- {{ article() }}
- {% elif content_type=='Quiz' %}
- {{ quiz() }}
- {% endif %}
-
- {{ navigation() }}
-
-
-
-
-{% endblock %}
-
-{% block script %}
- {% if content_type=='Video' %}
-
- {% elif content_type == 'Quiz' %}
-
- {% endif %}
-
-{% endblock %}
diff --git a/erpnext/www/lms/content.py b/erpnext/www/lms/content.py
deleted file mode 100644
index 99462ceeee5a..000000000000
--- a/erpnext/www/lms/content.py
+++ /dev/null
@@ -1,75 +0,0 @@
-import frappe
-
-import erpnext.education.utils as utils
-
-no_cache = 1
-
-
-def get_context(context):
- # Load Query Parameters
- try:
- program = frappe.form_dict["program"]
- content = frappe.form_dict["content"]
- content_type = frappe.form_dict["type"]
- course = frappe.form_dict["course"]
- topic = frappe.form_dict["topic"]
- except KeyError:
- frappe.local.flags.redirect_location = "/lms"
- raise frappe.Redirect
-
- # Check if user has access to the content
- has_program_access = utils.allowed_program_access(program)
- has_content_access = allowed_content_access(program, content, content_type)
-
- if frappe.session.user == "Guest" or not has_program_access or not has_content_access:
- frappe.local.flags.redirect_location = "/lms"
- raise frappe.Redirect
-
- # Set context for content to be displayer
- context.content = frappe.get_doc(content_type, content).as_dict()
- context.content_type = content_type
- context.program = program
- context.course = course
- context.topic = topic
-
- topic = frappe.get_doc("Topic", topic)
- content_list = [
- {"content_type": item.content_type, "content": item.content} for item in topic.topic_content
- ]
-
- # Set context for progress numbers
- context.position = content_list.index({"content": content, "content_type": content_type})
- context.length = len(content_list)
-
- # Set context for navigation
- context.previous = get_previous_content(content_list, context.position)
- context.next = get_next_content(content_list, context.position)
-
-
-def get_next_content(content_list, current_index):
- try:
- return content_list[current_index + 1]
- except IndexError:
- return None
-
-
-def get_previous_content(content_list, current_index):
- if current_index == 0:
- return None
- else:
- return content_list[current_index - 1]
-
-
-def allowed_content_access(program, content, content_type):
- contents_of_program = frappe.db.sql(
- """select `tabTopic Content`.content, `tabTopic Content`.content_type
- from `tabCourse Topic`,
- `tabProgram Course`,
- `tabTopic Content`
- where `tabCourse Topic`.parent = `tabProgram Course`.course
- and `tabTopic Content`.parent = `tabCourse Topic`.topic
- and `tabProgram Course`.parent = %(program)s""",
- {"program": program},
- )
-
- return (content, content_type) in contents_of_program
diff --git a/erpnext/www/lms/course.html b/erpnext/www/lms/course.html
deleted file mode 100644
index c07b9402b104..000000000000
--- a/erpnext/www/lms/course.html
+++ /dev/null
@@ -1,106 +0,0 @@
-{% extends "templates/base.html" %}
-{% block title %}{{ course.course_name }}{% endblock %}
-{% from "www/lms/macros/hero.html" import hero %}
-{% from "www/lms/macros/card.html" import null_card %}
-
-{% block head_include %}
-
-{% endblock %}
-
-
-{% macro card(topic) %}
-
-{% endmacro %}
-
-{% block content %}
-
- {{ hero(course.course_name, course.description, has_access, {'name': 'Program', 'url': '/lms/program?program=' + program }) }}
-
-
- {% for topic in topics %}
- {{ card(topic) }}
- {% endfor %}
- {% if topics %}
- {% for n in range( (3 - (topics|length)) %3) %}
- {{ null_card() }}
- {% endfor %}
- {% endif %}
-
-
-
-{% endblock %}
diff --git a/erpnext/www/lms/course.py b/erpnext/www/lms/course.py
deleted file mode 100644
index 840beee3ad2b..000000000000
--- a/erpnext/www/lms/course.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import frappe
-
-import erpnext.education.utils as utils
-
-no_cache = 1
-
-
-def get_context(context):
- try:
- program = frappe.form_dict["program"]
- course_name = frappe.form_dict["name"]
- except KeyError:
- frappe.local.flags.redirect_location = "/lms"
- raise frappe.Redirect
-
- context.education_settings = frappe.get_single("Education Settings")
- course = frappe.get_doc("Course", course_name)
- context.program = program
- context.course = course
-
- context.topics = course.get_topics()
- context.has_access = utils.allowed_program_access(context.program)
- context.progress = get_topic_progress(context.topics, course, context.program)
-
-
-def get_topic_progress(topics, course, program):
- progress = {topic.name: utils.get_topic_progress(topic, course.name, program) for topic in topics}
- return progress
diff --git a/erpnext/www/lms/index.html b/erpnext/www/lms/index.html
deleted file mode 100644
index c1e96205eb88..000000000000
--- a/erpnext/www/lms/index.html
+++ /dev/null
@@ -1,69 +0,0 @@
-{% extends "templates/base.html" %}
-{% block title %}{{ education_settings.portal_title }}{% endblock %}
-{% from "www/lms/macros/card.html" import program_card %}
-{% from "www/lms/macros/card.html" import null_card %}
-
-{% block head_include %}
-
-
-
-{% endblock %}
-
-{% block content %}
-
-
-
{{ education_settings.portal_title }}
- {% if education_settings.description %}
-
{{ education_settings.description }}
- {% endif %}
-
- {% if frappe.session.user == 'Guest' %}
- {{_('Sign Up')}}
- {% endif %}
-
-
-
-
- {% if featured_programs %}
- {% for program in featured_programs %}
- {{ program_card(program.program, program.has_access) }}
- {% endfor %}
- {% for n in range( (3 - (featured_programs|length)) %3) %}
- {{ null_card() }}
- {% endfor %}
- {% else %}
-
You have not enrolled in any program. Contact your Instructor.
- {% endif %}
-
-
-
-{% endblock %}
diff --git a/erpnext/www/lms/index.py b/erpnext/www/lms/index.py
deleted file mode 100644
index 782ac481a060..000000000000
--- a/erpnext/www/lms/index.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import frappe
-
-import erpnext.education.utils as utils
-
-no_cache = 1
-
-
-def get_context(context):
- context.education_settings = frappe.get_single("Education Settings")
- if not context.education_settings.enable_lms:
- frappe.local.flags.redirect_location = "/"
- raise frappe.Redirect
- context.featured_programs = get_featured_programs()
-
-
-def get_featured_programs():
- return utils.get_portal_programs() or []
diff --git a/erpnext/www/lms/macros/__init__.py b/erpnext/www/lms/macros/__init__.py
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/erpnext/www/lms/macros/card.html b/erpnext/www/lms/macros/card.html
deleted file mode 100644
index 3cbdec61aa08..000000000000
--- a/erpnext/www/lms/macros/card.html
+++ /dev/null
@@ -1,34 +0,0 @@
-{% macro program_card(program, has_access) %}
-
-{% endmacro %}
-
-
-{% macro null_card() %}
-
-{% endmacro %}
diff --git a/erpnext/www/lms/macros/hero.html b/erpnext/www/lms/macros/hero.html
deleted file mode 100644
index dd3c23a0145f..000000000000
--- a/erpnext/www/lms/macros/hero.html
+++ /dev/null
@@ -1,53 +0,0 @@
-{% macro hero(title, description, has_access, back) %}
-
-
-
{{ title }}
-
{{ description or ''}}
-
- {% if frappe.session.user == 'Guest' %}
- {{_('Sign Up')}}
- {% elif not has_access %}
- {{_('Enroll')}}
- {% endif %}
-
-
-
-{% block script %}
-
-{% endblock %}
-{% endmacro %}
diff --git a/erpnext/www/lms/profile.html b/erpnext/www/lms/profile.html
deleted file mode 100644
index 5755dfe6d8ed..000000000000
--- a/erpnext/www/lms/profile.html
+++ /dev/null
@@ -1,64 +0,0 @@
-{% extends "templates/base.html" %}
-{% block title %}Profile{% endblock %}
-{% from "www/lms/macros/hero.html" import hero %}
-
-{% block head_include %}
-
-{% endblock %}
-
-{% macro card(program) %}
-
-{% endmacro %}
-
-{% block content %}
-
-
-
-
{{ student.first_name }} {{ student.last_name or '' }}
-
{{ student.name }}
-
-
-
- {% for program in progress %}
- {{ card(program) }}
- {% endfor %}
-
-
-
-{% endblock %}
diff --git a/erpnext/www/lms/profile.py b/erpnext/www/lms/profile.py
deleted file mode 100644
index c4c1cd78eb70..000000000000
--- a/erpnext/www/lms/profile.py
+++ /dev/null
@@ -1,37 +0,0 @@
-import frappe
-
-import erpnext.education.utils as utils
-
-no_cache = 1
-
-
-def get_context(context):
- if frappe.session.user == "Guest":
- frappe.local.flags.redirect_location = "/lms"
- raise frappe.Redirect
-
- context.student = utils.get_current_student()
- if not context.student:
- context.student = frappe.get_doc("User", frappe.session.user)
- context.progress = get_program_progress(context.student.name)
-
-
-def get_program_progress(student):
- enrolled_programs = frappe.get_all(
- "Program Enrollment", filters={"student": student}, fields=["program"]
- )
- student_progress = []
- for list_item in enrolled_programs:
- program = frappe.get_doc("Program", list_item.program)
- progress = utils.get_program_progress(program)
- completion = utils.get_program_completion(program)
- student_progress.append(
- {
- "program": program.program_name,
- "name": program.name,
- "progress": progress,
- "completion": completion,
- }
- )
-
- return student_progress
diff --git a/erpnext/www/lms/program.html b/erpnext/www/lms/program.html
deleted file mode 100644
index 30528c667dd3..000000000000
--- a/erpnext/www/lms/program.html
+++ /dev/null
@@ -1,87 +0,0 @@
-{% extends "templates/base.html" %}
-{% block title %}{{ program.program_name }}{% endblock %}
-{% from "www/lms/macros/hero.html" import hero %}
-{% from "www/lms/macros/card.html" import null_card %}
-
-{% block head_include %}
-
-{% endblock %}
-
-
-{% macro card(course) %}
-
-{% endmacro %}
-
-{% block content %}
-
- {{ hero(program.program_name, program.description, has_access, {'name': 'Home', 'url': '/lms'}) }}
-
-
- {% for course in courses %}
- {{ card(course) }}
- {% endfor %}
- {% if courses %}
- {% for n in range( (3 - (courses|length)) %3) %}
- {{ null_card() }}
- {% endfor %}
- {% endif %}
-
-
-
-{% endblock %}
diff --git a/erpnext/www/lms/program.py b/erpnext/www/lms/program.py
deleted file mode 100644
index 1df2aa5bacdc..000000000000
--- a/erpnext/www/lms/program.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import frappe
-from frappe import _
-
-import erpnext.education.utils as utils
-
-no_cache = 1
-
-
-def get_context(context):
- try:
- program = frappe.form_dict["program"]
- except KeyError:
- frappe.local.flags.redirect_location = "/lms"
- raise frappe.Redirect
-
- context.education_settings = frappe.get_single("Education Settings")
- context.program = get_program(program)
- context.courses = [frappe.get_doc("Course", course.course) for course in context.program.courses]
- context.has_access = utils.allowed_program_access(program)
- context.progress = get_course_progress(context.courses, context.program)
-
-
-def get_program(program_name):
- try:
- return frappe.get_doc("Program", program_name)
- except frappe.DoesNotExistError:
- frappe.throw(_("Program {0} does not exist.").format(program_name))
-
-
-def get_course_progress(courses, program):
- progress = {course.name: utils.get_course_progress(course, program) for course in courses}
- return progress or {}
diff --git a/erpnext/www/lms/topic.html b/erpnext/www/lms/topic.html
deleted file mode 100644
index dc69599112ae..000000000000
--- a/erpnext/www/lms/topic.html
+++ /dev/null
@@ -1,58 +0,0 @@
-{% extends "templates/base.html" %}
-{% block title %}{{ topic.name }}{% endblock %}
-{% from "www/lms/macros/hero.html" import hero %}
-{% from "www/lms/macros/card.html" import null_card %}
-
-{% block head_include %}
-
-{% endblock %}
-
-
-{% macro card(content, index, length) %}
-
-{% endmacro %}
-
-{% block content %}
-
- {{ hero(topic.topic_name, topic.description, has_access, {'name': 'Course', 'url': '/lms/course?name=' + course +'&program=' + program}) }}
-
-
- {% for content in contents %}
- {{ card(content, loop.index, topic.contents|length) }}
- {% endfor %}
- {% if contents %}
- {% for n in range( (3 - (contents|length)) %3) %}
- {{ null_card() }}
- {% endfor %}
- {% endif %}
-
-
-
-{% endblock %}
diff --git a/erpnext/www/lms/topic.py b/erpnext/www/lms/topic.py
deleted file mode 100644
index 7783211a41b2..000000000000
--- a/erpnext/www/lms/topic.py
+++ /dev/null
@@ -1,57 +0,0 @@
-import frappe
-
-import erpnext.education.utils as utils
-
-no_cache = 1
-
-
-def get_context(context):
- try:
- course = frappe.form_dict["course"]
- program = frappe.form_dict["program"]
- topic = frappe.form_dict["topic"]
- except KeyError:
- frappe.local.flags.redirect_location = "/lms"
- raise frappe.Redirect
-
- context.program = program
- context.course = course
- context.topic = frappe.get_doc("Topic", topic)
- context.contents = get_contents(context.topic, course, program)
- context.has_access = utils.allowed_program_access(program)
-
-
-def get_contents(topic, course, program):
- student = utils.get_current_student()
- if student:
- course_enrollment = utils.get_or_create_course_enrollment(course, program)
- contents = topic.get_contents()
- progress = []
- if contents:
- for content in contents:
- if content.doctype in ("Article", "Video"):
- if student:
- status = utils.check_content_completion(content.name, content.doctype, course_enrollment.name)
- else:
- status = True
- progress.append({"content": content, "content_type": content.doctype, "completed": status})
- elif content.doctype == "Quiz":
- if student:
- status, score, result, time_taken = utils.check_quiz_completion(
- content, course_enrollment.name
- )
- else:
- status = False
- score = None
- result = None
- progress.append(
- {
- "content": content,
- "content_type": content.doctype,
- "completed": status,
- "score": score,
- "result": result,
- }
- )
-
- return progress