Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nabinhait committed Apr 21, 2016
2 parents d999ad6 + 59a45d9 commit 79966e2
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 40 deletions.
11 changes: 7 additions & 4 deletions .travis.yml
Expand Up @@ -6,20 +6,23 @@ python:
services:
- mysql

before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"

install:
- sudo apt-get purge -y mysql-common
- wget https://raw.githubusercontent.com/frappe/bench/master/install_scripts/setup_frappe.sh
- sudo bash setup_frappe.sh --skip-setup-bench --mysql-root-password travis
- sudo bash setup_frappe.sh --skip-setup-bench --mysql-root-password travis --bench-branch master
- sudo pip install --upgrade pip
- rm $TRAVIS_BUILD_DIR/.git/shallow
- sudo service redis-server start
- cd ~/ && bench init frappe-bench --frappe-path https://github.com/frappe/frappe.git --frappe-branch develop
- cd ~/ && bench init frappe-bench --frappe-path https://github.com/frappe/frappe.git --frappe-branch master
- cp -r $TRAVIS_BUILD_DIR/test_sites/test_site ~/frappe-bench/sites/


script:
- cd ~/frappe-bench
- bench get-app erpnext https://github.com/frappe/erpnext.git
- bench get-app erpnext https://github.com/frappe/erpnext.git --branch master
- bench get-app schools $TRAVIS_BUILD_DIR
- bench use test_site
- bench reinstall
Expand Down
2 changes: 1 addition & 1 deletion schools/__version__.py
@@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '0.1.0'
__version__ = '0.2.0'
13 changes: 13 additions & 0 deletions schools/academics/doctype/student_applicant/student_applicant.js
@@ -1,5 +1,18 @@
frappe.ui.form.on("Student Applicant", {
refresh: function(frm) {
if(frm.doc.application_status== "Applied" && frm.doc.docstatus== 1 ) {
frm.add_custom_button(__("Approve"), function() {
frm.set_value("application_status", "Approved");
frm.save_or_update();

}).addClass("btn-primary");

frm.add_custom_button(__("Reject"), function() {
frm.set_value("application_status", "Rejected");
frm.save_or_update();
}).addClass("btn-danger");
}

if(frm.doc.application_status== "Approved" && frm.doc.docstatus== 1 ) {
frm.add_custom_button(__("Enroll"), function() {
frm.events.enroll(frm)
Expand Down
59 changes: 41 additions & 18 deletions schools/academics/doctype/student_applicant/student_applicant.json
Expand Up @@ -18,6 +18,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Application Details",
Expand All @@ -35,20 +36,21 @@
"unique": 0
},
{
"allow_on_submit": 1,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:doc.docstatus != 0",
"fieldname": "application_status",
"fieldtype": "Select",
"default": "Today",
"fieldname": "application_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Application Status",
"label": "Application Date",
"length": 0,
"no_copy": 1,
"options": "Applied\nApproved\nRejected\nAdmitted",
"no_copy": 0,
"options": "",
"permlevel": 0,
"precision": "",
"print_hide": 0,
Expand All @@ -68,6 +70,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
Expand All @@ -84,20 +87,21 @@
"unique": 0
},
{
"allow_on_submit": 0,
"allow_on_submit": 1,
"bold": 0,
"collapsible": 0,
"default": "Today",
"fieldname": "application_date",
"fieldtype": "Date",
"depends_on": "eval:doc.docstatus != 0",
"fieldname": "application_status",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 0,
"label": "Application Date",
"label": "Application Status",
"length": 0,
"no_copy": 0,
"options": "",
"no_copy": 1,
"options": "Applied\nApproved\nRejected\nAdmitted",
"permlevel": 0,
"precision": "",
"print_hide": 0,
Expand All @@ -117,6 +121,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
Expand All @@ -140,6 +145,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "First Name",
Expand All @@ -164,6 +170,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Middle Name",
Expand All @@ -188,6 +195,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Last Name",
Expand All @@ -212,6 +220,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1,
"in_list_view": 1,
"label": "Program",
Expand All @@ -237,6 +246,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
Expand All @@ -260,6 +270,7 @@
"fieldtype": "Attach Image",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Image",
Expand All @@ -285,6 +296,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Personal Details",
Expand All @@ -309,6 +321,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Mother's Name",
Expand All @@ -333,6 +346,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Father's Name",
Expand All @@ -357,6 +371,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Contact",
Expand All @@ -382,6 +397,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
Expand All @@ -405,6 +421,7 @@
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Date of Birth",
Expand All @@ -429,6 +446,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Gender",
Expand All @@ -454,6 +472,7 @@
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Blood Group",
Expand All @@ -479,6 +498,7 @@
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Nationality",
Expand All @@ -503,6 +523,7 @@
"fieldtype": "Data",
"hidden": 1,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Title",
Expand All @@ -527,6 +548,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Amended From",
Expand Down Expand Up @@ -554,7 +576,7 @@
"istable": 0,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-02-01 12:33:59.754667",
"modified": "2016-04-18 16:27:57.056896",
"modified_by": "Administrator",
"module": "Academics",
"name": "Student Applicant",
Expand Down Expand Up @@ -602,10 +624,11 @@
"write": 1
}
],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "title",
"version": 0
"track_seen": 0
}
Expand Up @@ -16,6 +16,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Academic Year",
Expand All @@ -41,6 +42,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Academic Term",
Expand All @@ -66,6 +68,7 @@
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Get Courses",
Expand All @@ -90,6 +93,7 @@
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
Expand All @@ -114,6 +118,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Program",
Expand All @@ -139,6 +144,7 @@
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
Expand All @@ -162,6 +168,7 @@
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Courses",
Expand All @@ -174,7 +181,7 @@
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"unique": 0
Expand All @@ -189,8 +196,8 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
"modified": "2016-01-04 16:59:45.423419",
"modified_by": "Administrator",
"modified": "2016-04-08 06:42:09.898260",
"modified_by": "demo@erpnext.com",
"module": "Academics",
"name": "Student Group Creation Tool",
"name_case": "",
Expand Down Expand Up @@ -240,5 +247,6 @@
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
"sort_order": "DESC",
"track_seen": 0
}
Expand Up @@ -27,10 +27,16 @@ def get_courses(self):
return courses

def create_student_groups(self):
if not self.courses:
frappe.throw(_("""No Student Groups created."""))

for d in self.courses:
if not d.student_group_name:
frappe.throw(_("""Student Group Name is mandatory"""))
if not d.course:
frappe.throw(_("""Course is mandatory in row {0}""".format(d.idx)))

if not d.student_group_name:
frappe.throw(_("""Student Group Name is mandatory in row {0}""".format(d.idx)))

student_group = frappe.new_doc("Student Group")
student_group.group_name = d.student_group_name
student_group.course = d.course
Expand Down

0 comments on commit 79966e2

Please sign in to comment.