From bb5eb7d6f41ad7e347853fd5c14e36ab432d97e0 Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Thu, 15 Sep 2016 16:44:25 +0530 Subject: [PATCH] Added title to Student Admission (#6379) --- .../student_admission/student_admission.json | 30 +++++++++++++++++-- .../student_admission/student_admission.py | 4 +++ .../generators/student_admission.html | 6 +++- 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/erpnext/schools/doctype/student_admission/student_admission.json b/erpnext/schools/doctype/student_admission/student_admission.json index c956085ea7..e757ae1101 100644 --- a/erpnext/schools/doctype/student_admission/student_admission.json +++ b/erpnext/schools/doctype/student_admission/student_admission.json @@ -90,6 +90,32 @@ "set_only_once": 0, "unique": 0 }, + { + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "title", + "fieldtype": "Data", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Title", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, { "allow_on_submit": 0, "bold": 0, @@ -363,7 +389,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-09-15 05:59:18.435682", + "modified": "2016-09-15 07:03:55.581346", "modified_by": "Administrator", "module": "Schools", "name": "Student Admission", @@ -396,6 +422,6 @@ "read_only_onload": 0, "sort_field": "modified", "sort_order": "DESC", - "title_field": "program", + "title_field": "title", "track_seen": 0 } \ No newline at end of file diff --git a/erpnext/schools/doctype/student_admission/student_admission.py b/erpnext/schools/doctype/student_admission/student_admission.py index faf945622c..c4384e2133 100644 --- a/erpnext/schools/doctype/student_admission/student_admission.py +++ b/erpnext/schools/doctype/student_admission/student_admission.py @@ -16,6 +16,10 @@ class StudentAdmission(WebsiteGenerator): def get_context(self, context): context.parents = [{'name': 'admissions', 'title': _('All Student Admissions') }] + + def validate(self): + if not self.title: + self.title = self.program + " admissions for " + self.academic_year def get_list_context(context): context.title = _("Student Admissions") diff --git a/erpnext/templates/generators/student_admission.html b/erpnext/templates/generators/student_admission.html index bf138f0ea6..7eb92267c0 100644 --- a/erpnext/templates/generators/student_admission.html +++ b/erpnext/templates/generators/student_admission.html @@ -7,7 +7,7 @@ {% block header %} -

{{ program }}

+

{{ title }}

{% endblock %} {% block page_content %} @@ -22,6 +22,10 @@ {% endif %} + + + +
Program{{ program }}
Academic Year {{ academic_year }}