Changes in course and program

This commit is contained in:
Manas Solanki 2017-04-12 19:18:43 +05:30 committed by Nabin Hait
parent 346928f2bc
commit a6d1876958
6 changed files with 75 additions and 79 deletions

View File

@ -1,30 +1,30 @@
frappe.ui.form.on("Course", "refresh", function(frm) { frappe.ui.form.on("Course", "refresh", function(frm) {
if(!cur_frm.doc.__islocal) { if(!cur_frm.doc.__islocal) {
frm.add_custom_button(__("Program"), function() { frm.add_custom_button(__("Program"), function() {
frappe.route_options = { // frappe.route_options = {
"Program Course.course": frm.doc.name // "Program Course.course": frm.doc.name
} // }
frappe.set_route("List", "Program"); frappe.set_route("List", "Program");
}); });
frm.add_custom_button(__("Student Group"), function() { frm.add_custom_button(__("Student Group"), function() {
frappe.route_options = { // frappe.route_options = {
course: frm.doc.name // course: frm.doc.name
} // }
frappe.set_route("List", "Student Group"); frappe.set_route("List", "Student Group");
}); });
frm.add_custom_button(__("Course Schedule"), function() { frm.add_custom_button(__("Course Schedule"), function() {
frappe.route_options = { // frappe.route_options = {
course: frm.doc.name // course: frm.doc.name
} // }
frappe.set_route("List", "Course Schedule"); frappe.set_route("List", "Course Schedule");
}); });
frm.add_custom_button(__("Assessment Plan"), function() { frm.add_custom_button(__("Assessment Plan"), function() {
frappe.route_options = { // frappe.route_options = {
course: frm.doc.name // course: frm.doc.name
} // }
frappe.set_route("List", "Assessment Plan"); frappe.set_route("List", "Assessment Plan");
}); });
} }

View File

@ -1,8 +1,9 @@
{ {
"allow_copy": 0, "allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:course_name", "autoname": "field:course_code",
"beta": 0, "beta": 0,
"creation": "2015-09-07 12:39:55.181893", "creation": "2015-09-07 12:39:55.181893",
"custom": 0, "custom": 0,
@ -24,7 +25,7 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_global_search": 0, "in_global_search": 0,
"in_list_view": 0, "in_list_view": 1,
"in_standard_filter": 0, "in_standard_filter": 0,
"label": "Course Name", "label": "Course Name",
"length": 0, "length": 0,
@ -53,7 +54,7 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_global_search": 0, "in_global_search": 0,
"in_list_view": 1, "in_list_view": 0,
"in_standard_filter": 0, "in_standard_filter": 0,
"label": "Course Code", "label": "Course Code",
"length": 0, "length": 0,
@ -65,6 +66,35 @@
"read_only": 0, "read_only": 0,
"remember_last_selected_value": 0, "remember_last_selected_value": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "parent_course",
"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": "Parent Course (Leave blank, if this isn't part of Parent Course)",
"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, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
@ -110,7 +140,7 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_global_search": 0, "in_global_search": 0,
"in_list_view": 0, "in_list_view": 1,
"in_standard_filter": 0, "in_standard_filter": 0,
"label": "Course Abbreviation", "label": "Course Abbreviation",
"length": 0, "length": 0,
@ -304,18 +334,18 @@
"unique": 0 "unique": 0
} }
], ],
"has_web_view": 0,
"hide_heading": 0, "hide_heading": 0,
"hide_toolbar": 0, "hide_toolbar": 0,
"idx": 0, "idx": 0,
"image_view": 0, "image_view": 0,
"in_create": 0, "in_create": 0,
"in_dialog": 0,
"is_submittable": 0, "is_submittable": 0,
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"menu_index": 0, "menu_index": 0,
"modified": "2017-02-17 17:22:36.450073", "modified": "2017-04-10 14:54:59.943676",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Schools", "module": "Schools",
"name": "Course", "name": "Course",

View File

@ -1,43 +1,42 @@
// Copyright (c) 2015, Frappe Technologies and contributors // Copyright (c) 2015, Frappe Technologies and contributors
// For license information, please see license.txt // For license information, please see license.txt
cur_frm.add_fetch("course", "course_code", "course_code");
cur_frm.add_fetch('fee_structure', 'total_amount', 'amount'); cur_frm.add_fetch('fee_structure', 'total_amount', 'amount');
frappe.ui.form.on("Program", "refresh", function(frm) { frappe.ui.form.on("Program", "refresh", function(frm) {
if(!frm.doc.__islocal) { if(!frm.doc.__islocal) {
frm.add_custom_button(__("Student Applicant"), function() { frm.add_custom_button(__("Student Applicant"), function() {
frappe.route_options = { // frappe.route_options = {
program: frm.doc.name // program: frm.doc.name
} // }
frappe.set_route("List", "Student Applicant"); frappe.set_route("List", "Student Applicant");
}); });
frm.add_custom_button(__("Program Enrollment"), function() { frm.add_custom_button(__("Program Enrollment"), function() {
frappe.route_options = { // frappe.route_options = {
program: frm.doc.name // program: frm.doc.name
} // }
frappe.set_route("List", "Program Enrollment"); frappe.set_route("List", "Program Enrollment");
}); });
frm.add_custom_button(__("Student Group"), function() { frm.add_custom_button(__("Student Group"), function() {
frappe.route_options = { // frappe.route_options = {
program: frm.doc.name // program: frm.doc.name
} // }
frappe.set_route("List", "Student Group"); frappe.set_route("List", "Student Group");
}); });
frm.add_custom_button(__("Fee Structure"), function() { frm.add_custom_button(__("Fee Structure"), function() {
frappe.route_options = { // frappe.route_options = {
program: frm.doc.name // program: frm.doc.name
} // }
frappe.set_route("List", "Fee Structure"); frappe.set_route("List", "Fee Structure");
}); });
frm.add_custom_button(__("Fees"), function() { frm.add_custom_button(__("Fees"), function() {
frappe.route_options = { // frappe.route_options = {
program: frm.doc.name // program: frm.doc.name
} // }
frappe.set_route("List", "Fees"); frappe.set_route("List", "Fees");
}); });
} }

View File

@ -1,5 +1,6 @@
{ {
"allow_copy": 0, "allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 1, "allow_import": 1,
"allow_rename": 1, "allow_rename": 1,
"autoname": "field:program_name", "autoname": "field:program_name",
@ -82,7 +83,7 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_global_search": 0, "in_global_search": 0,
"in_list_view": 0, "in_list_view": 1,
"in_standard_filter": 0, "in_standard_filter": 0,
"label": "Program Abbreviation", "label": "Program Abbreviation",
"length": 0, "length": 0,
@ -276,18 +277,18 @@
"unique": 0 "unique": 0
} }
], ],
"has_web_view": 0,
"hide_heading": 0, "hide_heading": 0,
"hide_toolbar": 0, "hide_toolbar": 0,
"idx": 0, "idx": 0,
"image_view": 0, "image_view": 0,
"in_create": 0, "in_create": 0,
"in_dialog": 0,
"is_submittable": 0, "is_submittable": 0,
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 0, "max_attachments": 0,
"menu_index": 0, "menu_index": 0,
"modified": "2017-02-17 17:22:14.107052", "modified": "2017-04-07 17:57:37.392266",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Schools", "module": "Schools",
"name": "Program", "name": "Program",

View File

@ -7,10 +7,4 @@ import frappe
from frappe.model.document import Document from frappe.model.document import Document
class Program(Document): class Program(Document):
def validate(self): pass
self.validate_course()
def validate_course(self):
for d in self.courses:
if not d.course_code:
d.course_code = frappe.db.get_value("Course", d.course, "course_code")

View File

@ -1,5 +1,6 @@
{ {
"allow_copy": 0, "allow_copy": 0,
"allow_guest_to_view": 0,
"allow_import": 0, "allow_import": 0,
"allow_rename": 0, "allow_rename": 0,
"beta": 0, "beta": 0,
@ -41,36 +42,6 @@
"set_only_once": 0, "set_only_once": 0,
"unique": 0 "unique": 0
}, },
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"fieldname": "academic_term",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
"label": "Academic Term",
"length": 0,
"no_copy": 0,
"options": "Academic Term",
"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, "allow_on_submit": 0,
"bold": 0, "bold": 0,
@ -104,7 +75,7 @@
"bold": 0, "bold": 0,
"collapsible": 0, "collapsible": 0,
"columns": 0, "columns": 0,
"fieldname": "course_code", "fieldname": "course_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
@ -113,9 +84,10 @@
"in_global_search": 0, "in_global_search": 0,
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 0, "in_standard_filter": 0,
"label": "Course Code", "label": "Course Name",
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"options": "course.course_name",
"permlevel": 0, "permlevel": 0,
"precision": "", "precision": "",
"print_hide": 0, "print_hide": 0,
@ -140,7 +112,7 @@
"ignore_xss_filter": 0, "ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_global_search": 0, "in_global_search": 0,
"in_list_view": 0, "in_list_view": 1,
"in_standard_filter": 0, "in_standard_filter": 0,
"label": "Required", "label": "Required",
"length": 0, "length": 0,
@ -158,18 +130,18 @@
"unique": 0 "unique": 0
} }
], ],
"has_web_view": 0,
"hide_heading": 0, "hide_heading": 0,
"hide_toolbar": 0, "hide_toolbar": 0,
"idx": 0, "idx": 0,
"image_view": 0, "image_view": 0,
"in_create": 0, "in_create": 0,
"in_dialog": 0,
"is_submittable": 0, "is_submittable": 0,
"issingle": 0, "issingle": 0,
"istable": 1, "istable": 1,
"max_attachments": 0, "max_attachments": 0,
"menu_index": 0, "menu_index": 0,
"modified": "2017-02-17 17:16:10.315691", "modified": "2017-04-07 17:59:12.504949",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Schools", "module": "Schools",
"name": "Program Course", "name": "Program Course",