remove the print option from the tools (#11484)

* remove the print option for the tools

* better student search queries and minor fixes in the student group
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/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]))