diff --git a/erpnext/education/doctype/student_admission/student_admission.json b/erpnext/education/doctype/student_admission/student_admission.json
index 1096888d4d..75f21625b0 100644
--- a/erpnext/education/doctype/student_admission/student_admission.json
+++ b/erpnext/education/doctype/student_admission/student_admission.json
@@ -51,12 +51,14 @@
"fieldname": "admission_start_date",
"fieldtype": "Date",
"label": "Admission Start Date",
+ "mandatory_depends_on": "enable_admission_application",
"no_copy": 1
},
{
"fieldname": "admission_end_date",
"fieldtype": "Date",
"label": "Admission End Date",
+ "mandatory_depends_on": "enable_admission_application",
"no_copy": 1
},
{
@@ -83,6 +85,7 @@
},
{
"default": "0",
+ "depends_on": "published",
"fieldname": "enable_admission_application",
"fieldtype": "Check",
"label": "Enable Admission Application"
@@ -91,7 +94,7 @@
"has_web_view": 1,
"is_published_field": "published",
"links": [],
- "modified": "2020-06-15 20:18:38.591626",
+ "modified": "2020-09-18 00:14:54.615321",
"modified_by": "Administrator",
"module": "Education",
"name": "Student Admission",
diff --git a/erpnext/education/doctype/student_admission/student_admission.py b/erpnext/education/doctype/student_admission/student_admission.py
index 2781c9c50c..0febb96aeb 100644
--- a/erpnext/education/doctype/student_admission/student_admission.py
+++ b/erpnext/education/doctype/student_admission/student_admission.py
@@ -19,6 +19,9 @@ class StudentAdmission(WebsiteGenerator):
if not self.route: #pylint: disable=E0203
self.route = "admissions/" + "-".join(self.title.split(" "))
+ if self.enable_admission_application and not self.program_details:
+ frappe.throw(_("Please add programs to enable admission application."))
+
def get_context(self, context):
context.no_cache = 1
context.show_sidebar = True
diff --git a/erpnext/education/doctype/student_admission/templates/student_admission.html b/erpnext/education/doctype/student_admission/templates/student_admission.html
index e5a9ead31e..7ff3906b34 100644
--- a/erpnext/education/doctype/student_admission/templates/student_admission.html
+++ b/erpnext/education/doctype/student_admission/templates/student_admission.html
@@ -43,31 +43,35 @@
Program/Std.
- Minumum Age
- Maximum Age
+ Description
+ Minumum Age
+ Maximum Age
Application Fee
+ {%- if doc.enable_admission_application and frappe.utils.getdate(doc.admission_start_date) <= today -%}
+
+ {% endif %}