Merge branch 'shishu' of https://github.com/manassolanki/erpnext into manassolanki-shishu
This commit is contained in:
commit
1e3a0b4632
@ -375,3 +375,4 @@ erpnext.patches.v7_2.setup_auto_close_settings
|
||||
erpnext.patches.v7_2.empty_supplied_items_for_non_subcontracted
|
||||
erpnext.patches.v7_2.arrear_leave_encashment_as_salary_component
|
||||
erpnext.patches.v7_2.rename_att_date_attendance
|
||||
erpnext.patches.v7_2.update_attendance_docstatus
|
10
erpnext/patches/v7_2/update_attendance_docstatus.py
Normal file
10
erpnext/patches/v7_2/update_attendance_docstatus.py
Normal file
@ -0,0 +1,10 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
frappe.reload_doctype('Student Attendance')
|
||||
# frappe.reload_doc("schools", "doctype", "student_attendance")
|
||||
frappe.db.sql('''
|
||||
update `tabStudent Attendance` set
|
||||
docstatus=0
|
||||
where
|
||||
docstatus=1''')
|
@ -1,5 +1,5 @@
|
||||
<div class="col-sm-3">
|
||||
<div class="checkbox {% if status %} text-muted {% endif %}">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input
|
||||
type="checkbox"
|
||||
@ -7,9 +7,6 @@
|
||||
data-student="{{student}}"
|
||||
data-student-name="{{student_name}}"
|
||||
class="students-check"
|
||||
{% if status %}
|
||||
disabled="true"
|
||||
{% endif %}
|
||||
{% if status === "Present" %}
|
||||
checked
|
||||
{% endif %}
|
||||
|
@ -67,13 +67,23 @@ def mark_attendance(students_present, students_absent, course_schedule=None, stu
|
||||
frappe.msgprint(_("Attendance has been marked successfully."))
|
||||
|
||||
def make_attendance_records(student, student_name, status, course_schedule=None, student_batch=None, date=None):
|
||||
"""Creates Attendance Record.
|
||||
"""Creates/Update Attendance Record.
|
||||
|
||||
:param student: Student.
|
||||
:param student_name: Student Name.
|
||||
:param course_schedule: Course Schedule.
|
||||
:param status: Status (Present/Absent)
|
||||
"""
|
||||
student_attendance = frappe.db.get_value("Student Attendance", filters = {
|
||||
"student": student,
|
||||
"course_schedule": course_schedule,
|
||||
"student_batch": student_batch,
|
||||
"date": date
|
||||
})
|
||||
|
||||
if student_attendance:
|
||||
student_attendance = frappe.get_doc("Student Attendance", student_attendance)
|
||||
else:
|
||||
student_attendance = frappe.new_doc("Student Attendance")
|
||||
student_attendance.student = student
|
||||
student_attendance.student_name = student_name
|
||||
@ -81,7 +91,7 @@ def make_attendance_records(student, student_name, status, course_schedule=None,
|
||||
student_attendance.student_batch = student_batch
|
||||
student_attendance.date = date
|
||||
student_attendance.status = status
|
||||
student_attendance.submit()
|
||||
student_attendance.save()
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_student_guardians(student):
|
||||
|
@ -361,6 +361,63 @@
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
},
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "section_break_13",
|
||||
"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,
|
||||
"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_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "comment",
|
||||
"fieldtype": "Long Text",
|
||||
"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": "Comment",
|
||||
"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_on_submit": 0,
|
||||
"bold": 0,
|
||||
@ -401,7 +458,7 @@
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-02-20 13:20:51.700918",
|
||||
"modified": "2017-02-21 08:03:46.054604",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Schools",
|
||||
"name": "Assessment Result",
|
||||
|
@ -578,6 +578,7 @@
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"default": "INDIAN",
|
||||
"fieldname": "nationality",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
@ -1022,7 +1023,7 @@
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"menu_index": 0,
|
||||
"modified": "2017-02-20 13:20:10.117987",
|
||||
"modified": "2017-02-21 01:14:59.352772",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Schools",
|
||||
"name": "Student Applicant",
|
||||
|
@ -256,11 +256,11 @@
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 1,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-02-20 13:19:02.708904",
|
||||
"modified": "2017-02-21 01:15:20.989687",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Schools",
|
||||
"name": "Student Attendance",
|
||||
@ -268,9 +268,9 @@
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"amend": 1,
|
||||
"amend": 0,
|
||||
"apply_user_permissions": 0,
|
||||
"cancel": 1,
|
||||
"cancel": 0,
|
||||
"create": 1,
|
||||
"delete": 1,
|
||||
"email": 1,
|
||||
@ -284,7 +284,7 @@
|
||||
"role": "Academics User",
|
||||
"set_user_permissions": 0,
|
||||
"share": 1,
|
||||
"submit": 1,
|
||||
"submit": 0,
|
||||
"write": 1
|
||||
}
|
||||
],
|
||||
|
@ -121,6 +121,8 @@ schools.StudentsEditor = Class.extend({
|
||||
return !stud.disabled && !stud.checked;
|
||||
});
|
||||
|
||||
frappe.confirm(__("Do you want to save attendance?<br>Present: {0}\
|
||||
<br>Absent: {1}", [students_present.length, students_absent.length]), function() {
|
||||
frappe.call({
|
||||
method: "erpnext.schools.api.mark_attendance",
|
||||
args: {
|
||||
@ -136,6 +138,8 @@ schools.StudentsEditor = Class.extend({
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var htmls = students.map(function(student) {
|
||||
return frappe.render_template("student_button", {
|
||||
student: student.student,
|
||||
|
@ -23,6 +23,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Based On",
|
||||
@ -52,6 +53,7 @@
|
||||
"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,
|
||||
@ -80,6 +82,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Student Batch",
|
||||
@ -110,6 +113,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Course Schedule",
|
||||
@ -140,6 +144,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Date",
|
||||
@ -169,6 +174,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Attendance",
|
||||
@ -197,6 +203,7 @@
|
||||
"ignore_user_permissions": 0,
|
||||
"ignore_xss_filter": 0,
|
||||
"in_filter": 0,
|
||||
"in_global_search": 0,
|
||||
"in_list_view": 0,
|
||||
"in_standard_filter": 0,
|
||||
"label": "Students HTML",
|
||||
@ -225,7 +232,7 @@
|
||||
"issingle": 1,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2016-12-09 17:36:28.739318",
|
||||
"modified": "2017-02-21 01:15:11.435110",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Schools",
|
||||
"name": "Student Attendance Tool",
|
||||
@ -242,7 +249,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 0,
|
||||
"read": 1,
|
||||
@ -263,7 +269,6 @@
|
||||
"export": 0,
|
||||
"if_owner": 0,
|
||||
"import": 0,
|
||||
"is_custom": 0,
|
||||
"permlevel": 0,
|
||||
"print": 1,
|
||||
"read": 1,
|
||||
@ -278,7 +283,9 @@
|
||||
"quick_entry": 0,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"track_changes": 0,
|
||||
"track_seen": 0
|
||||
}
|
@ -27,10 +27,10 @@ def get_student_attendance_records(based_on, date=None, student_batch=None, cour
|
||||
|
||||
if course_schedule:
|
||||
student_attendance_list= frappe.db.sql("""select student, status from `tabStudent Attendance` where \
|
||||
course_schedule= %s and docstatus=1""", (course_schedule), as_dict=1)
|
||||
course_schedule= %s""", (course_schedule), as_dict=1)
|
||||
else:
|
||||
student_attendance_list= frappe.db.sql("""select student, status from `tabStudent Attendance` where \
|
||||
student_batch= %s and date= %s and docstatus=1 and \
|
||||
student_batch= %s and date= %s and \
|
||||
(course_schedule is Null or course_schedule='')""",
|
||||
(student_batch, date), as_dict=1)
|
||||
|
||||
@ -38,4 +38,5 @@ def get_student_attendance_records(based_on, date=None, student_batch=None, cour
|
||||
for student in student_list:
|
||||
if student.student == attendance.student:
|
||||
student.status = attendance.status
|
||||
|
||||
return student_list
|
@ -0,0 +1,8 @@
|
||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||
// For license information, please see license.txt
|
||||
|
||||
frappe.ui.form.on('Student Language', {
|
||||
refresh: function(frm) {
|
||||
|
||||
}
|
||||
});
|
@ -0,0 +1,92 @@
|
||||
{
|
||||
"allow_copy": 0,
|
||||
"allow_import": 0,
|
||||
"allow_rename": 0,
|
||||
"autoname": "",
|
||||
"beta": 0,
|
||||
"creation": "2017-02-21 01:55:00.366273",
|
||||
"custom": 0,
|
||||
"docstatus": 0,
|
||||
"doctype": "DocType",
|
||||
"document_type": "",
|
||||
"editable_grid": 1,
|
||||
"engine": "InnoDB",
|
||||
"fields": [
|
||||
{
|
||||
"allow_on_submit": 0,
|
||||
"bold": 0,
|
||||
"collapsible": 0,
|
||||
"columns": 0,
|
||||
"fieldname": "student_language",
|
||||
"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,
|
||||
"label": "Student Language",
|
||||
"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": 1,
|
||||
"search_index": 0,
|
||||
"set_only_once": 0,
|
||||
"unique": 0
|
||||
}
|
||||
],
|
||||
"hide_heading": 0,
|
||||
"hide_toolbar": 0,
|
||||
"idx": 0,
|
||||
"image_view": 0,
|
||||
"in_create": 0,
|
||||
"in_dialog": 0,
|
||||
"is_submittable": 0,
|
||||
"issingle": 0,
|
||||
"istable": 0,
|
||||
"max_attachments": 0,
|
||||
"modified": "2017-02-21 02:23:47.196351",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Schools",
|
||||
"name": "Student Language",
|
||||
"name_case": "",
|
||||
"owner": "Administrator",
|
||||
"permissions": [
|
||||
{
|
||||
"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
|
||||
}
|
||||
],
|
||||
"quick_entry": 1,
|
||||
"read_only": 0,
|
||||
"read_only_onload": 0,
|
||||
"show_name_in_global_search": 0,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC",
|
||||
"title_field": "",
|
||||
"track_changes": 1,
|
||||
"track_seen": 0
|
||||
}
|
12
erpnext/schools/doctype/student_language/student_language.py
Normal file
12
erpnext/schools/doctype/student_language/student_language.py
Normal file
@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
class StudentLanguage(Document):
|
||||
|
||||
def validate(self):
|
||||
self.name = self.student_language
|
@ -0,0 +1,12 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
# test_records = frappe.get_test_records('Student Language')
|
||||
|
||||
class TestStudentLanguage(unittest.TestCase):
|
||||
pass
|
@ -16,7 +16,7 @@
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2017-02-12 01:28:57.997942",
|
||||
"modified": "2017-02-21 04:44:46.022738",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Schools",
|
||||
"name": "student-applicant",
|
||||
@ -133,6 +133,7 @@
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"default": "INDIAN",
|
||||
"fieldname": "nationality",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
|
Loading…
Reference in New Issue
Block a user