Skip to content

Commit

Permalink
Merge pull request #128 from MSarari/develop
Browse files Browse the repository at this point in the history
Feat(academia): Add validation for Tool Doctypes
  • Loading branch information
alshalabi-su authored Jul 30, 2024
2 parents e1d364c + 74713ce commit 40be27c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
5 changes: 2 additions & 3 deletions academia/academia/doctype/student_group/student_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
"fieldname": "faculty",
"fieldtype": "Link",
"label": "Faculty",
"options": "Faculty",
"reqd": 1
"options": "Faculty"
},
{
"fieldname": "batch",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion academia/academia/doctype/student_group/student_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ frappe.ui.form.on('Student Group Tool', {
return {};
}
});
},
grouping_by: function(frm){
frm.set_value('practical_capacity', 0);
}
});

Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"field_order": [
"grouping_by",
"based_on",
"program",
"faculty",
"capacity",
"column_break_gtdl",
"faculty",
"program",
"student_batch",
"student_group",
"practical_capacity",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 40be27c

Please sign in to comment.