renamed 'active' in Student Batch to 'enabled'

This commit is contained in:
Neil Trini Lasrado 2016-12-01 13:28:21 +05:30
parent c6e74680ee
commit 19e8bd2221
14 changed files with 313 additions and 395 deletions

View File

@ -7,16 +7,6 @@ cur_frm.add_fetch("supervisor", "instructor_name", "supervisor_name");
cur_frm.add_fetch("student", "title", "student_name"); cur_frm.add_fetch("student", "title", "student_name");
frappe.ui.form.on("Assessment", { frappe.ui.form.on("Assessment", {
onload: function(frm){
cur_frm.set_query("student_batch", function(){
return{
"filters": {
"active": 1
}
};
});
},
student_group: function(frm) { student_group: function(frm) {
frm.set_value("results", ""); frm.set_value("results", "");
if (frm.doc.student_group) { if (frm.doc.student_group) {

View File

@ -6,15 +6,11 @@ from __future__ import unicode_literals
from frappe.model.document import Document from frappe.model.document import Document
import frappe import frappe
from frappe import _ from frappe import _
from erpnext.schools.doctype.student_batch.student_batch import validate_active_student_batch
class Assessment(Document): class Assessment(Document):
def validate(self): def validate(self):
self.validate_overlap() self.validate_overlap()
if self.student_batch:
validate_active_student_batch(self.student_batch)
def validate_overlap(self): def validate_overlap(self):
"""Validates overlap for Student Group/Student Batch, Instructor, Room""" """Validates overlap for Student Group/Student Batch, Instructor, Room"""

View File

@ -9,14 +9,6 @@ frappe.ui.form.on("Course Schedule" ,{
frm.doc.from_time = from_datetime.format("HH:mm:ss"); frm.doc.from_time = from_datetime.format("HH:mm:ss");
frm.doc.to_time = to_datetime.format("HH:mm:ss"); frm.doc.to_time = to_datetime.format("HH:mm:ss");
} }
cur_frm.set_query("student_batch", function(){
return{
"filters": {
"active": 1
}
};
});
}, },
refresh: function(frm) { refresh: function(frm) {
@ -30,8 +22,7 @@ frappe.ui.form.on("Course Schedule" ,{
if (r.message) { if (r.message) {
hide_field('attendance'); hide_field('attendance');
frm.events.view_attendance(frm) frm.events.view_attendance(frm)
} } else {
else {
frappe.call({ frappe.call({
method: "erpnext.schools.api.get_student_group_students", method: "erpnext.schools.api.get_student_group_students",
args: { args: {
@ -46,8 +37,7 @@ frappe.ui.form.on("Course Schedule" ,{
} }
} }
}); });
} } else {
else {
hide_field('attendance'); hide_field('attendance');
} }
}, },
@ -115,8 +105,7 @@ schools.StudentsEditor = Class.extend({
$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) { $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
if ($(check).is(":checked")) { if ($(check).is(":checked")) {
students_present.push(students[i]); students_present.push(students[i]);
} } else {
else {
students_absent.push(students[i]); students_absent.push(students[i]);
} }
}); });

View File

@ -6,7 +6,6 @@ from __future__ import unicode_literals
import frappe import frappe
from frappe import _ from frappe import _
from frappe.model.document import Document from frappe.model.document import Document
from erpnext.schools.doctype.student_batch.student_batch import validate_active_student_batch
class CourseSchedule(Document): class CourseSchedule(Document):
def validate(self): def validate(self):
@ -18,9 +17,6 @@ class CourseSchedule(Document):
self.validate_date() self.validate_date()
self.validate_overlap() self.validate_overlap()
if self.student_batch:
validate_active_student_batch(self.student_batch)
def set_title(self): def set_title(self):
"""Set document Title""" """Set document Title"""
self.title = self.course + " by " + (self.instructor_name if self.instructor_name else self.instructor) self.title = self.course + " by " + (self.instructor_name if self.instructor_name else self.instructor)

View File

@ -17,15 +17,5 @@ frappe.ui.form.on("Course Scheduling Tool", {
doc: frm.doc doc: frm.doc
}) })
}); });
},
onload: function(frm){
cur_frm.set_query("student_batch", function(){
return{
"filters": {
"active": 1
}
};
});
} }
}); });

View File

@ -2,16 +2,4 @@
// For license information, please see license.txt // For license information, please see license.txt
cur_frm.add_fetch("course_schedule", "schedule_date", "date"); cur_frm.add_fetch("course_schedule", "schedule_date", "date");
cur_frm.add_fetch("course_schedule", "student_batch", "student_batch"); cur_frm.add_fetch("course_schedule", "student_batch", "student_batch")
frappe.ui.form.on('Student Attendance', {
onload: function(frm){
cur_frm.set_query("student_batch", function(){
return{
"filters": {
"active": 1
}
};
});
}
});

View File

@ -6,7 +6,6 @@ from __future__ import unicode_literals
import frappe import frappe
from frappe.model.document import Document from frappe.model.document import Document
from frappe import _ from frappe import _
from erpnext.schools.doctype.student_batch.student_batch import validate_active_student_batch
class StudentAttendance(Document): class StudentAttendance(Document):
def validate(self): def validate(self):
@ -14,9 +13,6 @@ class StudentAttendance(Document):
self.validate_mandatory() self.validate_mandatory()
self.validate_duplication() self.validate_duplication()
if self.student_batch:
validate_active_student_batch(self.student_batch)
def validate_date(self): def validate_date(self):
if self.course_schedule: if self.course_schedule:
self.date = frappe.db.get_value("Course Schedule", self.course_schedule, "schedule_date") self.date = frappe.db.get_value("Course Schedule", self.course_schedule, "schedule_date")

View File

@ -76,7 +76,7 @@
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"default": "1", "default": "1",
"fieldname": "active", "fieldname": "enabled",
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
@ -309,7 +309,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"modified": "2016-12-01 12:56:51.727827", "modified": "2016-12-01 13:18:12.024001",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Schools", "module": "Schools",
"name": "Student Batch", "name": "Student Batch",

View File

@ -6,7 +6,6 @@ from __future__ import unicode_literals
from frappe.model.document import Document from frappe.model.document import Document
from erpnext.schools.utils import validate_duplicate_student from erpnext.schools.utils import validate_duplicate_student
import frappe import frappe
from frappe import _
class StudentBatch(Document): class StudentBatch(Document):
def autoname(self): def autoname(self):
@ -17,7 +16,3 @@ class StudentBatch(Document):
def validate(self): def validate(self):
validate_duplicate_student(self.students) validate_duplicate_student(self.students)
def validate_active_student_batch(student_batch):
if not frappe.db.get_value("Student Batch", student_batch, "active"):
frappe.throw(_("Student Batch is not Active."))

View File

@ -8,16 +8,6 @@ frappe.ui.form.on('Student Batch Attendance Tool', {
hide_field('attendance'); hide_field('attendance');
}, },
onload: function(frm){
cur_frm.set_query("student_batch", function(){
return{
"filters": {
"active": 1
}
};
});
},
student_batch: function(frm) { student_batch: function(frm) {
if (frm.doc.student_batch && frm.doc.date) { if (frm.doc.student_batch && frm.doc.date) {
frappe.call({ frappe.call({
@ -30,8 +20,7 @@ frappe.ui.form.on('Student Batch Attendance Tool', {
if (r.message) { if (r.message) {
frappe.msgprint("Attendance already marked."); frappe.msgprint("Attendance already marked.");
hide_field('attendance'); hide_field('attendance');
} } else {
else {
frappe.call({ frappe.call({
method: "erpnext.schools.api.get_student_batch_students", method: "erpnext.schools.api.get_student_batch_students",
args: { args: {
@ -107,8 +96,7 @@ schools.StudentsEditor = Class.extend({
$(me.wrapper).find('input[type="checkbox"]').each(function(i, check) { $(me.wrapper).find('input[type="checkbox"]').each(function(i, check) {
if ($(check).is(":checked")) { if ($(check).is(":checked")) {
students_present.push(students[i]); students_present.push(students[i]);
} } else {
else {
students_absent.push(students[i]); students_absent.push(students[i]);
} }
}); });

View File

@ -27,14 +27,6 @@ frappe.ui.form.on("Student Group", {
} }
}; };
}); });
cur_frm.set_query("student_batch", function(){
return{
"filters": {
"active": 1
}
};
});
} }
}); });

View File

@ -7,7 +7,6 @@ import frappe
from frappe.model.document import Document from frappe.model.document import Document
from frappe import _ from frappe import _
from erpnext.schools.utils import validate_duplicate_student from erpnext.schools.utils import validate_duplicate_student
from erpnext.schools.doctype.student_batch.student_batch import validate_active_student_batch
class StudentGroup(Document): class StudentGroup(Document):
def autoname(self): def autoname(self):
@ -32,9 +31,6 @@ class StudentGroup(Document):
self.validate_student_name() self.validate_student_name()
validate_duplicate_student(self.students) validate_duplicate_student(self.students)
if self.student_batch:
validate_active_student_batch(self.student_batch)
def validate_strength(self): def validate_strength(self):
if self.max_strength and len(self.students) > self.max_strength: if self.max_strength and len(self.students) > self.max_strength:
frappe.throw(_("""Cannot enroll more than {0} students for this student group.""").format(self.max_strength)) frappe.throw(_("""Cannot enroll more than {0} students for this student group.""").format(self.max_strength))

View File

@ -2,16 +2,17 @@
"add_total_row": 0, "add_total_row": 0,
"apply_user_permissions": 1, "apply_user_permissions": 1,
"creation": "2013-05-13 14:04:03", "creation": "2013-05-13 14:04:03",
"disabled": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-06-03 07:18:17.181332", "modified": "2016-12-01 14:28:27.184668",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Schools", "module": "Schools",
"name": "Absent Student Report", "name": "Absent Student Report",
"owner": "Administrator", "owner": "Administrator",
"ref_doctype": "Attendance", "ref_doctype": "Student Attendance",
"report_name": "Absent Student Report", "report_name": "Absent Student Report",
"report_type": "Script Report" "report_type": "Script Report"
} }

View File

@ -2,16 +2,17 @@
"add_total_row": 0, "add_total_row": 0,
"apply_user_permissions": 1, "apply_user_permissions": 1,
"creation": "2013-05-13 14:04:03", "creation": "2013-05-13 14:04:03",
"disabled": 0,
"docstatus": 0, "docstatus": 0,
"doctype": "Report", "doctype": "Report",
"idx": 1, "idx": 1,
"is_standard": "Yes", "is_standard": "Yes",
"modified": "2014-06-03 07:18:17.181332", "modified": "2016-12-01 14:29:53.547378",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Schools", "module": "Schools",
"name": "Student Monthly Attendance Sheet", "name": "Student Monthly Attendance Sheet",
"owner": "Administrator", "owner": "Administrator",
"ref_doctype": "Attendance", "ref_doctype": "Student Attendance",
"report_name": "Student Monthly Attendance Sheet", "report_name": "Student Monthly Attendance Sheet",
"report_type": "Script Report" "report_type": "Script Report"
} }