commits from develop merged PR's (#11491)

* better student search queries and minor fixes in the student group

* remove the print option for the tools

* fixes for the chart

* minor fixes in the fee module for print and permission, delete redundant doctype

* set the naming series and independent dob validation
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 220250b..8d7ca10 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -456,4 +456,5 @@
 erpnext.patches.v9_0.set_uoms_in_variant_field
 erpnext.patches.v9_0.copy_old_fees_field_data
 erpnext.patches.v9_0.set_pos_profile_name
-erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings
\ No newline at end of file
+erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings
+execute:frappe.delete_doc_if_exists("DocType", "Program Fee")
diff --git a/erpnext/schools/doctype/assessment_result/assessment_result.js b/erpnext/schools/doctype/assessment_result/assessment_result.js
index e75f314..7bd1d19 100644
--- a/erpnext/schools/doctype/assessment_result/assessment_result.js
+++ b/erpnext/schools/doctype/assessment_result/assessment_result.js
@@ -7,23 +7,25 @@
 
 frappe.ui.form.on("Assessment Result", {
 	assessment_plan: function(frm) {
-		frappe.call({
-			method: "erpnext.schools.api.get_assessment_details",
-			args: {
-				assessment_plan: frm.doc.assessment_plan
-			},
-			callback: function(r) {
-				if (r.message) {
-					frm.doc.details = [];
-					$.each(r.message, function(i, d) {
-						var row = frappe.model.add_child(frm.doc, "Assessment Result Detail", "details");
-						row.assessment_criteria = d.assessment_criteria;
-						row.maximum_score = d.maximum_score;
-					});
+		if (frm.doc.assessment_plan) {
+			frappe.call({
+				method: "erpnext.schools.api.get_assessment_details",
+				args: {
+					assessment_plan: frm.doc.assessment_plan
+				},
+				callback: function(r) {
+					if (r.message) {
+						frm.doc.details = [];
+						$.each(r.message, function(i, d) {
+							var row = frappe.model.add_child(frm.doc, "Assessment Result Detail", "details");
+							row.assessment_criteria = d.assessment_criteria;
+							row.maximum_score = d.maximum_score;
+						});
+					}
+					refresh_field("details");
 				}
-				refresh_field("details");
-			}
-		});
+			});
+		}
 	}
 });
 
diff --git a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
index a62a4d5..116fbad 100644
--- a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
+++ b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json
@@ -175,7 +175,7 @@
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:47.184562", 
+ "modified": "2017-11-08 11:51:43.247815", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Assessment Result Tool", 
@@ -188,17 +188,17 @@
    "cancel": 0, 
    "create": 1, 
    "delete": 0, 
-   "email": 1, 
+   "email": 0, 
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
    "permlevel": 0, 
-   "print": 1, 
+   "print": 0, 
    "read": 1, 
    "report": 0, 
    "role": "Academics User", 
    "set_user_permissions": 0, 
-   "share": 1, 
+   "share": 0, 
    "submit": 0, 
    "write": 1
   }
diff --git a/erpnext/schools/doctype/fee_category/fee_category.json b/erpnext/schools/doctype/fee_category/fee_category.json
index c51027a..2b55f8d 100644
--- a/erpnext/schools/doctype/fee_category/fee_category.json
+++ b/erpnext/schools/doctype/fee_category/fee_category.json
@@ -90,7 +90,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-30 08:21:47.851347", 
+ "modified": "2017-11-02 17:57:18.069158", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Fee Category", 
@@ -116,6 +116,46 @@
    "share": 1, 
    "submit": 0, 
    "write": 1
+  }, 
+  {
+   "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": "Accounts User", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 0, 
+   "write": 1
+  }, 
+  {
+   "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": "Accounts Manager", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 0, 
+   "write": 1
   }
  ], 
  "quick_entry": 1, 
diff --git a/erpnext/schools/doctype/fee_schedule/fee_schedule.json b/erpnext/schools/doctype/fee_schedule/fee_schedule.json
index d2b5c52..ab60911 100644
--- a/erpnext/schools/doctype/fee_schedule/fee_schedule.json
+++ b/erpnext/schools/doctype/fee_schedule/fee_schedule.json
@@ -25,7 +25,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
-   "in_global_search": 0, 
+   "in_global_search": 1, 
    "in_list_view": 1, 
    "in_standard_filter": 0, 
    "label": "Fee Structure", 
@@ -1029,7 +1029,7 @@
  "issingle": 0, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-09-19 16:24:17.266071", 
+ "modified": "2017-11-02 17:55:22.851581", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Fee Schedule", 
@@ -1039,7 +1039,7 @@
   {
    "amend": 1, 
    "apply_user_permissions": 0, 
-   "cancel": 1, 
+   "cancel": 0, 
    "create": 1, 
    "delete": 1, 
    "email": 1, 
@@ -1053,6 +1053,46 @@
    "role": "Academics User", 
    "set_user_permissions": 0, 
    "share": 1, 
+   "submit": 0, 
+   "write": 1
+  }, 
+  {
+   "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": "Accounts User", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 1, 
+   "write": 1
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Accounts Manager", 
+   "set_user_permissions": 0, 
+   "share": 1, 
    "submit": 1, 
    "write": 1
   }
@@ -1060,6 +1100,7 @@
  "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", 
diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.json b/erpnext/schools/doctype/fee_structure/fee_structure.json
index d93a667..2ae0a48 100644
--- a/erpnext/schools/doctype/fee_structure/fee_structure.json
+++ b/erpnext/schools/doctype/fee_structure/fee_structure.json
@@ -165,7 +165,7 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 1, 
+   "reqd": 0, 
    "search_index": 1, 
    "set_only_once": 0, 
    "unique": 0, 
@@ -197,7 +197,7 @@
    "read_only": 0, 
    "remember_last_selected_value": 0, 
    "report_hide": 0, 
-   "reqd": 0, 
+   "reqd": 1, 
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
@@ -577,7 +577,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-09-11 15:18:27.975666", 
+ "modified": "2017-11-02 17:43:16.796845", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Fee Structure", 
@@ -587,7 +587,7 @@
   {
    "amend": 1, 
    "apply_user_permissions": 0, 
-   "cancel": 1, 
+   "cancel": 0, 
    "create": 1, 
    "delete": 1, 
    "email": 1, 
@@ -601,6 +601,46 @@
    "role": "Academics User", 
    "set_user_permissions": 0, 
    "share": 1, 
+   "submit": 0, 
+   "write": 1
+  }, 
+  {
+   "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": "Accounts User", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 1, 
+   "write": 1
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
+   "cancel": 1, 
+   "create": 1, 
+   "delete": 1, 
+   "email": 1, 
+   "export": 1, 
+   "if_owner": 0, 
+   "import": 0, 
+   "permlevel": 0, 
+   "print": 1, 
+   "read": 1, 
+   "report": 1, 
+   "role": "Accounts Manager", 
+   "set_user_permissions": 0, 
+   "share": 1, 
    "submit": 1, 
    "write": 1
   }
@@ -609,6 +649,7 @@
  "read_only": 0, 
  "read_only_onload": 0, 
  "restrict_to_domain": "Education", 
+ "search_fields": "program, student_category, academic_year", 
  "show_name_in_global_search": 0, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
diff --git a/erpnext/schools/doctype/fees/fees.json b/erpnext/schools/doctype/fees/fees.json
index ab9a792..f34caf7 100644
--- a/erpnext/schools/doctype/fees/fees.json
+++ b/erpnext/schools/doctype/fees/fees.json
@@ -1,7 +1,7 @@
 {
  "allow_copy": 0, 
  "allow_guest_to_view": 0, 
- "allow_import": 0, 
+ "allow_import": 1, 
  "allow_rename": 0, 
  "autoname": "naming_series:", 
  "beta": 1, 
@@ -87,7 +87,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
-   "in_global_search": 0, 
+   "in_global_search": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Student Name", 
@@ -118,7 +118,7 @@
    "ignore_user_permissions": 0, 
    "ignore_xss_filter": 0, 
    "in_filter": 0, 
-   "in_global_search": 0, 
+   "in_global_search": 1, 
    "in_list_view": 0, 
    "in_standard_filter": 0, 
    "label": "Fee Schedule", 
@@ -158,7 +158,7 @@
    "no_copy": 0, 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -249,7 +249,7 @@
    "options": "Company", 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 1, 
+   "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 1, 
@@ -310,7 +310,7 @@
    "no_copy": 1, 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 1, 
+   "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -494,7 +494,7 @@
    "options": "Student Batch Name", 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -708,7 +708,7 @@
    "options": "Currency", 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 1, 
    "remember_last_selected_value": 0, 
@@ -739,7 +739,7 @@
    "options": "Fee Structure", 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -1011,7 +1011,7 @@
    "no_copy": 0, 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -1132,7 +1132,7 @@
    "no_copy": 0, 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -1163,7 +1163,7 @@
    "options": "Account", 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -1194,7 +1194,7 @@
    "options": "Account", 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -1223,7 +1223,7 @@
    "no_copy": 0, 
    "permlevel": 0, 
    "precision": "", 
-   "print_hide": 0, 
+   "print_hide": 1, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
    "remember_last_selected_value": 0, 
@@ -1254,6 +1254,35 @@
    "options": "Cost Center", 
    "permlevel": 0, 
    "precision": "", 
+   "print_hide": 1, 
+   "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": "data_42", 
+   "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, 
+   "length": 0, 
+   "no_copy": 0, 
+   "permlevel": 0, 
+   "precision": "", 
    "print_hide": 0, 
    "print_hide_if_no_value": 0, 
    "read_only": 0, 
@@ -1276,7 +1305,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-09-20 23:17:09.819606", 
+ "modified": "2017-11-02 17:31:47.155873", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Fees", 
@@ -1286,6 +1315,46 @@
   {
    "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
+  }, 
+  {
+   "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": "Accounts User", 
+   "set_user_permissions": 0, 
+   "share": 1, 
+   "submit": 1, 
+   "write": 1
+  }, 
+  {
+   "amend": 0, 
+   "apply_user_permissions": 0, 
    "cancel": 1, 
    "create": 1, 
    "delete": 1, 
@@ -1297,7 +1366,7 @@
    "print": 1, 
    "read": 1, 
    "report": 1, 
-   "role": "Academics User", 
+   "role": "Accounts Manager", 
    "set_user_permissions": 0, 
    "share": 1, 
    "submit": 1, 
@@ -1308,7 +1377,8 @@
  "read_only": 0, 
  "read_only_onload": 0, 
  "restrict_to_domain": "Education", 
- "show_name_in_global_search": 0, 
+ "search_fields": "student, student_name", 
+ "show_name_in_global_search": 1, 
  "sort_field": "modified", 
  "sort_order": "DESC", 
  "title_field": "student_name", 
diff --git a/erpnext/schools/doctype/program/program.json b/erpnext/schools/doctype/program/program.json
index 95ef166..46581a1 100644
--- a/erpnext/schools/doctype/program/program.json
+++ b/erpnext/schools/doctype/program/program.json
@@ -223,67 +223,6 @@
    "search_index": 0, 
    "set_only_once": 0, 
    "unique": 0
-  }, 
-  {
-   "allow_bulk_edit": 0, 
-   "allow_on_submit": 0, 
-   "bold": 0, 
-   "collapsible": 0, 
-   "columns": 0, 
-   "fieldname": "fee_schedule", 
-   "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": "Fee Schedule", 
-   "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": "fees", 
-   "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": "Fees", 
-   "length": 0, 
-   "no_copy": 0, 
-   "options": "Program Fee", 
-   "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
   }
  ], 
  "has_web_view": 0, 
@@ -297,7 +236,7 @@
  "istable": 0, 
  "max_attachments": 0, 
  "menu_index": 0, 
- "modified": "2017-06-30 08:21:49.176708", 
+ "modified": "2017-11-02 18:08:20.823972", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Program", 
diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.py b/erpnext/schools/doctype/student_applicant/student_applicant.py
index 8cc2cbd..6d0957c 100644
--- a/erpnext/schools/doctype/student_applicant/student_applicant.py
+++ b/erpnext/schools/doctype/student_applicant/student_applicant.py
@@ -14,9 +14,12 @@
 		if self.student_admission:
 			naming_series = None
 			if self.program:
+				# set the naming series from the student admission if provided.
 				student_admission = get_student_admission_data(self.student_admission, self.program)
 				if student_admission:
 					naming_series = student_admission.get("applicant_naming_series")
+				else:
+					naming_series = None
 			else:
 				frappe.throw(_("Select the program first"))
 
@@ -41,15 +44,16 @@
 
 	def validation_from_student_admission(self):
 		student_admission = get_student_admission_data(self.student_admission, self.program)
-		if student_admission:
-			if ((
-					student_admission.minimum_age
-					and getdate(student_admission.minimum_age) > getdate(self.date_of_birth)
-				) or (
-					student_admission.maximum_age
-					and getdate(student_admission.maximum_age) < getdate(self.date_of_birth)
-				)):
-					frappe.throw(_("Not eligible for the admission in this program as per DOB"))
+
+		# different validation for minimum and maximum age so that either min/max can also work independently.
+		if student_admission and student_admission.minimum_age and \
+			getdate(student_admission.minimum_age) < getdate(self.date_of_birth):
+				frappe.throw(_("Not eligible for the admission in this program as per DOB"))
+
+		if student_admission and student_admission.maximum_age and \
+			getdate(student_admission.maximum_age) > getdate(self.date_of_birth):
+				frappe.throw(_("Not eligible for the admission in this program as per DOB"))
+
 
 	def on_payment_authorized(self, *args, **kwargs):
 		self.db_set('paid', 1)
diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
index 59c1a84..5c28655 100644
--- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
+++ b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json
@@ -273,7 +273,7 @@
  "issingle": 1, 
  "istable": 0, 
  "max_attachments": 0, 
- "modified": "2017-06-30 08:21:51.390809", 
+ "modified": "2017-11-08 11:53:27.994112", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Attendance Tool", 
@@ -306,17 +306,17 @@
    "cancel": 0, 
    "create": 1, 
    "delete": 0, 
-   "email": 1, 
+   "email": 0, 
    "export": 0, 
    "if_owner": 0, 
    "import": 0, 
    "permlevel": 0, 
-   "print": 1, 
+   "print": 0, 
    "read": 1, 
    "report": 0, 
    "role": "Academics User", 
    "set_user_permissions": 0, 
-   "share": 1, 
+   "share": 0, 
    "submit": 0, 
    "write": 1
   }
diff --git a/erpnext/schools/doctype/student_group/student_group.py b/erpnext/schools/doctype/student_group/student_group.py
index 0a7fdf1..950632b 100644
--- a/erpnext/schools/doctype/student_group/student_group.py
+++ b/erpnext/schools/doctype/student_group/student_group.py
@@ -7,6 +7,7 @@
 from frappe.model.document import Document
 from frappe import _
 from erpnext.schools.utils import validate_duplicate_student
+from frappe.utils import cint
 
 class StudentGroup(Document):
 	def validate(self):
@@ -34,9 +35,13 @@
 		for d in self.students:
 			if not frappe.db.get_value("Student", d.student, "enabled") and d.active:
 				frappe.throw(_("{0} - {1} is inactive student".format(d.group_roll_number, d.student_name)))
-			if self.group_based_on == "Batch" and d.student not in students and frappe.defaults.get_defaults().validate_batch:
+
+			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 d.student not in students and frappe.defaults.get_defaults().validate_course:
+
+			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):
@@ -108,14 +113,14 @@
 		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
+			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, start, page_len]))
+			tuple(students + ["%%%s%%" % txt, "%%%s%%" % txt, start, page_len]))
 	else:
 		return frappe.db.sql("""select name, title from tabStudent
-			where `{0}` LIKE %s
+			where `{0}` LIKE %s or title LIKE %s
 			order by idx desc, name
 			limit %s, %s""".format(searchfield),
-			tuple(["%%%s%%" % txt, start, page_len]))
+			tuple(["%%%s%%" % txt, "%%%s%%" % txt, start, page_len]))
 
diff --git a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py b/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
index 9bdf621..492d738 100644
--- a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
+++ b/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py
@@ -173,14 +173,16 @@
 def get_chart_data(grades, assessment_criteria_list, kounter):
 	grades = sorted(grades)
 	datasets = []
+
 	for grade in grades:
-		tmp = []
-		for ac in assessment_criteria_list:
-			if grade in kounter[ac]:
-				tmp.append(kounter[ac][grade])
+		tmp = frappe._dict({"values":[], "title": grade})
+		for criteria in assessment_criteria_list:
+			if grade in kounter[criteria]:
+				tmp["values"].append(kounter[criteria][grade])
 			else:
-				tmp.append(0)
+				tmp["values"].append(0)
 		datasets.append(tmp)
+
 	return {
 		"data": {
 			"labels": assessment_criteria_list,