Merge pull request #7956 from manassolanki/sibling

[Fixes] School
This commit is contained in:
Nabin Hait 2017-03-09 11:04:38 +05:30 committed by GitHub
commit 733855a4c3
3 changed files with 25 additions and 7 deletions

View File

@ -1 +1,17 @@
cur_frm.add_fetch("guardian", "guardian_name", "guardian_name");
// 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");
}
});

View File

@ -6,6 +6,7 @@ from __future__ import unicode_literals
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 @@ class StudentAttendance(Document):
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))

View File

@ -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",