Merge pull request #7956 from manassolanki/sibling

[Fixes] School
diff --git a/erpnext/schools/doctype/student/student.js b/erpnext/schools/doctype/student/student.js
index 10fefae..c7b1d46 100644
--- a/erpnext/schools/doctype/student/student.js
+++ b/erpnext/schools/doctype/student/student.js
@@ -1 +1,17 @@
-cur_frm.add_fetch("guardian", "guardian_name", "guardian_name");
\ No newline at end of file
+// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
+// For license information, please see license.txt
+
+
+frappe.ui.form.on("Student Guardian", {
+	guardian: function(frm) {
+		frm.add_fetch("guardian", "guardian_name", "guardian_name");
+	}
+});
+
+frappe.ui.form.on('Student Sibling', {
+	student: function(frm) {
+		frm.add_fetch("student", "title", "full_name");
+		frm.add_fetch("student", "gender", "gender");
+		frm.add_fetch("student", "date_of_birth", "date_of_birth");
+	}
+});
diff --git a/erpnext/schools/doctype/student_attendance/student_attendance.py b/erpnext/schools/doctype/student_attendance/student_attendance.py
index 8e806e4..8a72e70 100644
--- a/erpnext/schools/doctype/student_attendance/student_attendance.py
+++ b/erpnext/schools/doctype/student_attendance/student_attendance.py
@@ -6,6 +6,7 @@
 import frappe
 from frappe.model.document import Document
 from frappe import _
+from frappe.utils import cstr
 from erpnext.schools.api import get_student_batch_students, get_student_group_students
 
 
@@ -49,11 +50,11 @@
 		attendance_records=None
 		if self.course_schedule:
 			attendance_records= frappe.db.sql("""select name from `tabStudent Attendance` where \
-				student= %s and course_schedule= %s and name != %s and docstatus=1""",
-				(self.student, self.course_schedule, self.name))
+				student= %s and ifnull(course_schedule, '')= %s and name != %s""",
+				(self.student, cstr(self.course_schedule), self.name))
 		else:
 			attendance_records= frappe.db.sql("""select name from `tabStudent Attendance` where \
-				student= %s and student_batch= %s and date= %s and name != %s and docstatus=1 and \
+				student= %s and student_batch= %s and date= %s and name != %s and \
 				(course_schedule is Null or course_schedule='')""",
 				(self.student, self.student_batch, self.date, self.name))
 			
diff --git a/erpnext/schools/doctype/student_sibling/student_sibling.json b/erpnext/schools/doctype/student_sibling/student_sibling.json
index 87cdbf1..fb698d9 100644
--- a/erpnext/schools/doctype/student_sibling/student_sibling.json
+++ b/erpnext/schools/doctype/student_sibling/student_sibling.json
@@ -1,5 +1,6 @@
 {
  "allow_copy": 0, 
+ "allow_guest_to_view": 0, 
  "allow_import": 0, 
  "allow_rename": 0, 
  "beta": 0, 
@@ -8,7 +9,7 @@
  "docstatus": 0, 
  "doctype": "DocType", 
  "document_type": "", 
- "editable_grid": 1, 
+ "editable_grid": 0, 
  "fields": [
   {
    "allow_on_submit": 0, 
@@ -250,17 +251,17 @@
    "unique": 0
   }
  ], 
+ "has_web_view": 0, 
  "hide_heading": 0, 
  "hide_toolbar": 0, 
  "idx": 0, 
  "image_view": 0, 
  "in_create": 0, 
- "in_dialog": 0, 
  "is_submittable": 0, 
  "issingle": 0, 
  "istable": 1, 
  "max_attachments": 0, 
- "modified": "2017-02-24 11:43:01.311010", 
+ "modified": "2017-03-08 11:26:41.717041", 
  "modified_by": "Administrator", 
  "module": "Schools", 
  "name": "Student Sibling",