From bc99560f4b9927da6ffac10818d9c5e075e79243 Mon Sep 17 00:00:00 2001 From: MSarari Date: Tue, 30 Jul 2024 18:21:35 +0300 Subject: [PATCH 1/3] feat(academia): add validation to Course Study Tool Doctype --- .../doctype/course_study_tool/course_study_tool.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/academia/academia/doctype/course_study_tool/course_study_tool.js b/academia/academia/doctype/course_study_tool/course_study_tool.js index 05576308..34d5ce3e 100644 --- a/academia/academia/doctype/course_study_tool/course_study_tool.js +++ b/academia/academia/doctype/course_study_tool/course_study_tool.js @@ -73,5 +73,13 @@ frappe.ui.form.on('Course Study Tool', { return {}; } }); + }, + based_on: function(frm){ + frm.set_value('level', null); + frm.set_value('academic_program', null); + frm.set_value('program_specification', null); + frm.set_value('student_batch', null); + frm.set_value('specific_level', null); + frm.set_value('specific_program', null); } }); From fcbb2d9f49211bbe7481fb12edbd006b10243ff4 Mon Sep 17 00:00:00 2001 From: MSarari Date: Tue, 30 Jul 2024 18:34:16 +0300 Subject: [PATCH 2/3] feat(academia): add validation to Student Group Tool Doctype --- academia/academia/doctype/student_group/student_group.json | 5 ++--- academia/academia/doctype/student_group/student_group.py | 2 +- .../doctype/student_group_tool/student_group_tool.js | 3 +++ .../doctype/student_group_tool/student_group_tool.json | 6 +++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/academia/academia/doctype/student_group/student_group.json b/academia/academia/doctype/student_group/student_group.json index 13c71166..65082a13 100644 --- a/academia/academia/doctype/student_group/student_group.json +++ b/academia/academia/doctype/student_group/student_group.json @@ -48,8 +48,7 @@ "fieldname": "faculty", "fieldtype": "Link", "label": "Faculty", - "options": "Faculty", - "reqd": 1 + "options": "Faculty" }, { "fieldname": "batch", @@ -128,7 +127,7 @@ ], "index_web_pages_for_search": 1, "links": [], - "modified": "2024-07-27 05:00:15.731785", + "modified": "2024-07-30 18:05:05.377522", "modified_by": "Administrator", "module": "Academia", "name": "Student Group", diff --git a/academia/academia/doctype/student_group/student_group.py b/academia/academia/doctype/student_group/student_group.py index 83c1a0d3..1351373a 100644 --- a/academia/academia/doctype/student_group/student_group.py +++ b/academia/academia/doctype/student_group/student_group.py @@ -16,7 +16,7 @@ class StudentGroup(Document): from frappe.types import DF batch: DF.Link - faculty: DF.Link + faculty: DF.Link | None group_based_on: DF.Data program: DF.Link student_group_name: DF.Data diff --git a/academia/academia/doctype/student_group_tool/student_group_tool.js b/academia/academia/doctype/student_group_tool/student_group_tool.js index 4d73bbe7..7f8793c8 100644 --- a/academia/academia/doctype/student_group_tool/student_group_tool.js +++ b/academia/academia/doctype/student_group_tool/student_group_tool.js @@ -125,6 +125,9 @@ frappe.ui.form.on('Student Group Tool', { return {}; } }); + }, + grouping_by: function(frm){ + frm.set_value('practical_capacity', 0); } }); diff --git a/academia/academia/doctype/student_group_tool/student_group_tool.json b/academia/academia/doctype/student_group_tool/student_group_tool.json index 53de4f81..ce0256ba 100644 --- a/academia/academia/doctype/student_group_tool/student_group_tool.json +++ b/academia/academia/doctype/student_group_tool/student_group_tool.json @@ -7,10 +7,10 @@ "field_order": [ "grouping_by", "based_on", - "program", + "faculty", "capacity", "column_break_gtdl", - "faculty", + "program", "student_batch", "student_group", "practical_capacity", @@ -111,7 +111,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2024-07-21 15:00:56.612921", + "modified": "2024-07-30 18:31:15.830838", "modified_by": "Administrator", "module": "Academia", "name": "Student Group Tool", From 74713ce4fc74e73932c59f55debd6e34ece7fba4 Mon Sep 17 00:00:00 2001 From: MSarari Date: Tue, 30 Jul 2024 18:40:28 +0300 Subject: [PATCH 3/3] feat(academia): add validation to Course Enrollment Tool Doctype --- .../course_enrollment_tool/course_enrollment_tool.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/academia/academia/doctype/course_enrollment_tool/course_enrollment_tool.js b/academia/academia/doctype/course_enrollment_tool/course_enrollment_tool.js index 16297b0c..a86dcf6e 100644 --- a/academia/academia/doctype/course_enrollment_tool/course_enrollment_tool.js +++ b/academia/academia/doctype/course_enrollment_tool/course_enrollment_tool.js @@ -75,5 +75,11 @@ frappe.ui.form.on('Course Enrollment Tool', { return {}; } }); + }, + academic_program: function(frm){ + frm.set_value('specific_program', null); + }, + level: function(frm){ + frm.set_value('specific_level', null); } });