From 40016372c6cb44baa519e79cc43c3e72885c0187 Mon Sep 17 00:00:00 2001 From: pratu16x7 Date: Wed, 8 Nov 2017 16:30:15 +0530 Subject: [PATCH 1/8] [minor][hotfix] naming_series variable assignment --- erpnext/schools/doctype/student_applicant/student_applicant.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.py b/erpnext/schools/doctype/student_applicant/student_applicant.py index 465b4e474a..8cc2cbd7c9 100644 --- a/erpnext/schools/doctype/student_applicant/student_applicant.py +++ b/erpnext/schools/doctype/student_applicant/student_applicant.py @@ -12,6 +12,7 @@ class StudentApplicant(Document): def autoname(self): from frappe.model.naming import set_name_by_naming_series if self.student_admission: + naming_series = None if self.program: student_admission = get_student_admission_data(self.student_admission, self.program) if student_admission: From 4a864c1eea27ce8062a1ab224552beb7d6e22e43 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Thu, 9 Nov 2017 19:01:21 +0530 Subject: [PATCH 2/8] [fix] Update bom item description (#11498) * [fix] Update bom item description * Update item.py --- erpnext/stock/doctype/item/item.py | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 844d62bd17..6a6af3d583 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -91,7 +91,7 @@ class Item(WebsiteGenerator): self.validate_barcode() self.cant_change() self.validate_warehouse_for_reorder() - self.update_item_desc() + self.update_bom_item_desc() self.synced_with_hub = 0 self.validate_has_variants() @@ -599,13 +599,27 @@ class Item(WebsiteGenerator): row.label = label row.description = desc - def update_item_desc(self): - if frappe.db.get_value('BOM',self.name, 'description') != self.description: - frappe.db.sql("""update `tabBOM` set description = %s where item = %s and docstatus < 2""",(self.description, self.name)) - frappe.db.sql("""update `tabBOM Item` set description = %s where - item_code = %s and docstatus < 2""",(self.description, self.name)) - frappe.db.sql("""update `tabBOM Explosion Item` set description = %s where - item_code = %s and docstatus < 2""",(self.description, self.name)) + def update_bom_item_desc(self): + if self.is_new(): return + + if self.db_get('description') != self.description: + frappe.db.sql(""" + update `tabBOM` + set description = %s + where item = %s and docstatus < 2 + """, (self.description, self.name)) + + frappe.db.sql(""" + update `tabBOM Item` + set description = %s + where item_code = %s and docstatus < 2 + """, (self.description, self.name)) + + frappe.db.sql(""" + update `tabBOM Explosion Item` + set description = %s + where item_code = %s and docstatus < 2 + """, (self.description, self.name)) def update_template_item(self): """Set Show in Website for Template Item if True for its Variant""" From 99e31f97b86a9a29ca4e6a2d4db0e352186ff326 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 10 Nov 2017 10:50:49 +0530 Subject: [PATCH 3/8] set default params for paging (#11500) --- erpnext/controllers/queries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index b1618d5eb9..37afed7a0e 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -185,7 +185,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters, as_dict=Fals "page_len": page_len }, as_dict=as_dict) -def bom(doctype, txt, searchfield, start, page_len, filters): +def bom(doctype, txt, searchfield, filters, start=0, page_len=20): conditions = [] return frappe.db.sql("""select tabBOM.name, tabBOM.item From 1ce48e7032070cda0c5f503a7b52a8799dd632d3 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Fri, 10 Nov 2017 10:53:12 +0530 Subject: [PATCH 4/8] [fix] POS profile patch (#11501) --- erpnext/patches/v9_0/set_pos_profile_name.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v9_0/set_pos_profile_name.py b/erpnext/patches/v9_0/set_pos_profile_name.py index 3ae3774e3e..1958e2c777 100644 --- a/erpnext/patches/v9_0/set_pos_profile_name.py +++ b/erpnext/patches/v9_0/set_pos_profile_name.py @@ -11,7 +11,7 @@ def execute(): for pos in frappe.get_all(doctype, filters={'disabled': 0}): doc = frappe.get_doc(doctype, pos.name) - if not doc.user and doc.pos_profile_name: continue + if not doc.user or doc.pos_profile_name: continue try: doc.pos_profile_name = doc.user + ' - ' + doc.company From aeb002635475babf8a63a75683b5efa0b440e691 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Fri, 10 Nov 2017 10:58:43 +0530 Subject: [PATCH 5/8] commits from develop merged PR's (#11491) * better student search queries and minor fixes in the student group * remove the print option for the tools * fixes for the chart * minor fixes in the fee module for print and permission, delete redundant doctype * set the naming series and independent dob validation --- erpnext/patches.txt | 3 +- .../assessment_result/assessment_result.js | 34 +++--- .../assessment_result_tool.json | 8 +- .../doctype/fee_category/fee_category.json | 42 ++++++- .../doctype/fee_schedule/fee_schedule.json | 47 +++++++- .../doctype/fee_structure/fee_structure.json | 49 ++++++++- erpnext/schools/doctype/fees/fees.json | 104 +++++++++++++++--- erpnext/schools/doctype/program/program.json | 63 +---------- .../student_applicant/student_applicant.py | 22 ++-- .../student_attendance_tool.json | 8 +- .../doctype/student_group/student_group.py | 17 ++- .../course_wise_assessment_report.py | 12 +- 12 files changed, 277 insertions(+), 132 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 220250b131..8d7ca10a19 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -456,4 +456,5 @@ erpnext.patches.v9_0.set_variant_item_description erpnext.patches.v9_0.set_uoms_in_variant_field erpnext.patches.v9_0.copy_old_fees_field_data erpnext.patches.v9_0.set_pos_profile_name -erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings \ No newline at end of file +erpnext.patches.v9_0.remove_non_existing_warehouse_from_stock_settings +execute:frappe.delete_doc_if_exists("DocType", "Program Fee") diff --git a/erpnext/schools/doctype/assessment_result/assessment_result.js b/erpnext/schools/doctype/assessment_result/assessment_result.js index e75f314a04..7bd1d1960b 100644 --- a/erpnext/schools/doctype/assessment_result/assessment_result.js +++ b/erpnext/schools/doctype/assessment_result/assessment_result.js @@ -7,23 +7,25 @@ cur_frm.add_fetch("assessment_plan", "maximum_assessment_score", "maximum_score" frappe.ui.form.on("Assessment Result", { assessment_plan: function(frm) { - frappe.call({ - method: "erpnext.schools.api.get_assessment_details", - args: { - assessment_plan: frm.doc.assessment_plan - }, - callback: function(r) { - if (r.message) { - frm.doc.details = []; - $.each(r.message, function(i, d) { - var row = frappe.model.add_child(frm.doc, "Assessment Result Detail", "details"); - row.assessment_criteria = d.assessment_criteria; - row.maximum_score = d.maximum_score; - }); + if (frm.doc.assessment_plan) { + frappe.call({ + method: "erpnext.schools.api.get_assessment_details", + args: { + assessment_plan: frm.doc.assessment_plan + }, + callback: function(r) { + if (r.message) { + frm.doc.details = []; + $.each(r.message, function(i, d) { + var row = frappe.model.add_child(frm.doc, "Assessment Result Detail", "details"); + row.assessment_criteria = d.assessment_criteria; + row.maximum_score = d.maximum_score; + }); + } + refresh_field("details"); } - refresh_field("details"); - } - }); + }); + } } }); diff --git a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json index a62a4d5434..116fbad81e 100644 --- a/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json +++ b/erpnext/schools/doctype/assessment_result_tool/assessment_result_tool.json @@ -175,7 +175,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2017-06-30 08:21:47.184562", + "modified": "2017-11-08 11:51:43.247815", "modified_by": "Administrator", "module": "Schools", "name": "Assessment Result Tool", @@ -188,17 +188,17 @@ "cancel": 0, "create": 1, "delete": 0, - "email": 1, + "email": 0, "export": 0, "if_owner": 0, "import": 0, "permlevel": 0, - "print": 1, + "print": 0, "read": 1, "report": 0, "role": "Academics User", "set_user_permissions": 0, - "share": 1, + "share": 0, "submit": 0, "write": 1 } diff --git a/erpnext/schools/doctype/fee_category/fee_category.json b/erpnext/schools/doctype/fee_category/fee_category.json index c51027a389..2b55f8d87a 100644 --- a/erpnext/schools/doctype/fee_category/fee_category.json +++ b/erpnext/schools/doctype/fee_category/fee_category.json @@ -90,7 +90,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-06-30 08:21:47.851347", + "modified": "2017-11-02 17:57:18.069158", "modified_by": "Administrator", "module": "Schools", "name": "Fee Category", @@ -116,6 +116,46 @@ "share": 1, "submit": 0, "write": 1 + }, + { + "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": "Accounts User", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 + }, + { + "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": "Accounts Manager", + "set_user_permissions": 0, + "share": 1, + "submit": 0, + "write": 1 } ], "quick_entry": 1, diff --git a/erpnext/schools/doctype/fee_schedule/fee_schedule.json b/erpnext/schools/doctype/fee_schedule/fee_schedule.json index d2b5c52227..ab609112a1 100644 --- a/erpnext/schools/doctype/fee_schedule/fee_schedule.json +++ b/erpnext/schools/doctype/fee_schedule/fee_schedule.json @@ -25,7 +25,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_global_search": 0, + "in_global_search": 1, "in_list_view": 1, "in_standard_filter": 0, "label": "Fee Structure", @@ -1029,7 +1029,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2017-09-19 16:24:17.266071", + "modified": "2017-11-02 17:55:22.851581", "modified_by": "Administrator", "module": "Schools", "name": "Fee Schedule", @@ -1039,7 +1039,7 @@ { "amend": 1, "apply_user_permissions": 0, - "cancel": 1, + "cancel": 0, "create": 1, "delete": 1, "email": 1, @@ -1053,6 +1053,46 @@ "role": "Academics User", "set_user_permissions": 0, "share": 1, + "submit": 0, + "write": 1 + }, + { + "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": "Accounts User", + "set_user_permissions": 0, + "share": 1, + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "set_user_permissions": 0, + "share": 1, "submit": 1, "write": 1 } @@ -1060,6 +1100,7 @@ "quick_entry": 0, "read_only": 0, "read_only_onload": 0, + "restrict_to_domain": "Education", "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", diff --git a/erpnext/schools/doctype/fee_structure/fee_structure.json b/erpnext/schools/doctype/fee_structure/fee_structure.json index d93a667bd3..2ae0a488bb 100644 --- a/erpnext/schools/doctype/fee_structure/fee_structure.json +++ b/erpnext/schools/doctype/fee_structure/fee_structure.json @@ -165,7 +165,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 1, + "reqd": 0, "search_index": 1, "set_only_once": 0, "unique": 0, @@ -197,7 +197,7 @@ "read_only": 0, "remember_last_selected_value": 0, "report_hide": 0, - "reqd": 0, + "reqd": 1, "search_index": 0, "set_only_once": 0, "unique": 0 @@ -577,7 +577,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-09-11 15:18:27.975666", + "modified": "2017-11-02 17:43:16.796845", "modified_by": "Administrator", "module": "Schools", "name": "Fee Structure", @@ -587,7 +587,7 @@ { "amend": 1, "apply_user_permissions": 0, - "cancel": 1, + "cancel": 0, "create": 1, "delete": 1, "email": 1, @@ -601,6 +601,46 @@ "role": "Academics User", "set_user_permissions": 0, "share": 1, + "submit": 0, + "write": 1 + }, + { + "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": "Accounts User", + "set_user_permissions": 0, + "share": 1, + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "apply_user_permissions": 0, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "if_owner": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "set_user_permissions": 0, + "share": 1, "submit": 1, "write": 1 } @@ -609,6 +649,7 @@ "read_only": 0, "read_only_onload": 0, "restrict_to_domain": "Education", + "search_fields": "program, student_category, academic_year", "show_name_in_global_search": 0, "sort_field": "modified", "sort_order": "DESC", diff --git a/erpnext/schools/doctype/fees/fees.json b/erpnext/schools/doctype/fees/fees.json index ab9a792c68..f34caf77c4 100644 --- a/erpnext/schools/doctype/fees/fees.json +++ b/erpnext/schools/doctype/fees/fees.json @@ -1,7 +1,7 @@ { "allow_copy": 0, "allow_guest_to_view": 0, - "allow_import": 0, + "allow_import": 1, "allow_rename": 0, "autoname": "naming_series:", "beta": 1, @@ -87,7 +87,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_global_search": 0, + "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 0, "label": "Student Name", @@ -118,7 +118,7 @@ "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 0, - "in_global_search": 0, + "in_global_search": 1, "in_list_view": 0, "in_standard_filter": 0, "label": "Fee Schedule", @@ -158,7 +158,7 @@ "no_copy": 0, "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -249,7 +249,7 @@ "options": "Company", "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 1, @@ -310,7 +310,7 @@ "no_copy": 1, "permlevel": 0, "precision": "", - "print_hide": 1, + "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -494,7 +494,7 @@ "options": "Student Batch Name", "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -708,7 +708,7 @@ "options": "Currency", "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 1, "remember_last_selected_value": 0, @@ -739,7 +739,7 @@ "options": "Fee Structure", "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -1011,7 +1011,7 @@ "no_copy": 0, "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -1132,7 +1132,7 @@ "no_copy": 0, "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -1163,7 +1163,7 @@ "options": "Account", "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -1194,7 +1194,7 @@ "options": "Account", "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -1223,7 +1223,7 @@ "no_copy": 0, "permlevel": 0, "precision": "", - "print_hide": 0, + "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, @@ -1254,6 +1254,35 @@ "options": "Cost Center", "permlevel": 0, "precision": "", + "print_hide": 1, + "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_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "data_42", + "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, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", "print_hide": 0, "print_hide_if_no_value": 0, "read_only": 0, @@ -1276,13 +1305,53 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-09-20 23:17:09.819606", + "modified": "2017-11-02 17:31:47.155873", "modified_by": "Administrator", "module": "Schools", "name": "Fees", "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 + }, + { + "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": "Accounts User", + "set_user_permissions": 0, + "share": 1, + "submit": 1, + "write": 1 + }, { "amend": 0, "apply_user_permissions": 0, @@ -1297,7 +1366,7 @@ "print": 1, "read": 1, "report": 1, - "role": "Academics User", + "role": "Accounts Manager", "set_user_permissions": 0, "share": 1, "submit": 1, @@ -1308,7 +1377,8 @@ "read_only": 0, "read_only_onload": 0, "restrict_to_domain": "Education", - "show_name_in_global_search": 0, + "search_fields": "student, student_name", + "show_name_in_global_search": 1, "sort_field": "modified", "sort_order": "DESC", "title_field": "student_name", diff --git a/erpnext/schools/doctype/program/program.json b/erpnext/schools/doctype/program/program.json index 95ef166cb9..46581a16ca 100644 --- a/erpnext/schools/doctype/program/program.json +++ b/erpnext/schools/doctype/program/program.json @@ -223,67 +223,6 @@ "search_index": 0, "set_only_once": 0, "unique": 0 - }, - { - "allow_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "fee_schedule", - "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, - "label": "Fee Schedule", - "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_bulk_edit": 0, - "allow_on_submit": 0, - "bold": 0, - "collapsible": 0, - "columns": 0, - "fieldname": "fees", - "fieldtype": "Table", - "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": "Fees", - "length": 0, - "no_copy": 0, - "options": "Program Fee", - "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 } ], "has_web_view": 0, @@ -297,7 +236,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2017-06-30 08:21:49.176708", + "modified": "2017-11-02 18:08:20.823972", "modified_by": "Administrator", "module": "Schools", "name": "Program", diff --git a/erpnext/schools/doctype/student_applicant/student_applicant.py b/erpnext/schools/doctype/student_applicant/student_applicant.py index 8cc2cbd7c9..6d0957c502 100644 --- a/erpnext/schools/doctype/student_applicant/student_applicant.py +++ b/erpnext/schools/doctype/student_applicant/student_applicant.py @@ -14,9 +14,12 @@ class StudentApplicant(Document): if self.student_admission: naming_series = None if self.program: + # set the naming series from the student admission if provided. student_admission = get_student_admission_data(self.student_admission, self.program) if student_admission: naming_series = student_admission.get("applicant_naming_series") + else: + naming_series = None else: frappe.throw(_("Select the program first")) @@ -41,15 +44,16 @@ class StudentApplicant(Document): def validation_from_student_admission(self): student_admission = get_student_admission_data(self.student_admission, self.program) - if student_admission: - if (( - student_admission.minimum_age - and getdate(student_admission.minimum_age) > getdate(self.date_of_birth) - ) or ( - student_admission.maximum_age - and getdate(student_admission.maximum_age) < getdate(self.date_of_birth) - )): - frappe.throw(_("Not eligible for the admission in this program as per DOB")) + + # different validation for minimum and maximum age so that either min/max can also work independently. + if student_admission and student_admission.minimum_age and \ + getdate(student_admission.minimum_age) < getdate(self.date_of_birth): + frappe.throw(_("Not eligible for the admission in this program as per DOB")) + + if student_admission and student_admission.maximum_age and \ + getdate(student_admission.maximum_age) > getdate(self.date_of_birth): + frappe.throw(_("Not eligible for the admission in this program as per DOB")) + def on_payment_authorized(self, *args, **kwargs): self.db_set('paid', 1) diff --git a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json index 59c1a84240..5c28655fa7 100644 --- a/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json +++ b/erpnext/schools/doctype/student_attendance_tool/student_attendance_tool.json @@ -273,7 +273,7 @@ "issingle": 1, "istable": 0, "max_attachments": 0, - "modified": "2017-06-30 08:21:51.390809", + "modified": "2017-11-08 11:53:27.994112", "modified_by": "Administrator", "module": "Schools", "name": "Student Attendance Tool", @@ -306,17 +306,17 @@ "cancel": 0, "create": 1, "delete": 0, - "email": 1, + "email": 0, "export": 0, "if_owner": 0, "import": 0, "permlevel": 0, - "print": 1, + "print": 0, "read": 1, "report": 0, "role": "Academics User", "set_user_permissions": 0, - "share": 1, + "share": 0, "submit": 0, "write": 1 } diff --git a/erpnext/schools/doctype/student_group/student_group.py b/erpnext/schools/doctype/student_group/student_group.py index 0a7fdf1e85..950632ba50 100644 --- a/erpnext/schools/doctype/student_group/student_group.py +++ b/erpnext/schools/doctype/student_group/student_group.py @@ -7,6 +7,7 @@ import frappe from frappe.model.document import Document from frappe import _ from erpnext.schools.utils import validate_duplicate_student +from frappe.utils import cint class StudentGroup(Document): def validate(self): @@ -34,9 +35,13 @@ class StudentGroup(Document): for d in self.students: if not frappe.db.get_value("Student", d.student, "enabled") and d.active: frappe.throw(_("{0} - {1} is inactive student".format(d.group_roll_number, d.student_name))) - if self.group_based_on == "Batch" and d.student not in students and frappe.defaults.get_defaults().validate_batch: + + if (self.group_based_on == "Batch") and cint(frappe.defaults.get_defaults().validate_batch)\ + and d.student not in students: frappe.throw(_("{0} - {1} is not enrolled in the Batch {2}".format(d.group_roll_number, d.student_name, self.batch))) - if self.group_based_on == "Course" and d.student not in students and frappe.defaults.get_defaults().validate_course: + + if (self.group_based_on == "Course") and cint(frappe.defaults.get_defaults().validate_course)\ + and (d.student not in students): frappe.throw(_("{0} - {1} is not enrolled in the Course {2}".format(d.group_roll_number, d.student_name, self.course))) def validate_and_set_child_table_fields(self): @@ -108,14 +113,14 @@ def fetch_students(doctype, txt, searchfield, start, page_len, filters): students = ([d.student for d in enrolled_students if d.student not in student_group_student] if enrolled_students else [""]) or [""] return frappe.db.sql("""select name, title from tabStudent - where name in ({0}) and `{1}` LIKE %s + where name in ({0}) and (`{1}` LIKE %s or title LIKE %s) order by idx desc, name limit %s, %s""".format(", ".join(['%s']*len(students)), searchfield), - tuple(students + ["%%%s%%" % txt, start, page_len])) + tuple(students + ["%%%s%%" % txt, "%%%s%%" % txt, start, page_len])) else: return frappe.db.sql("""select name, title from tabStudent - where `{0}` LIKE %s + where `{0}` LIKE %s or title LIKE %s order by idx desc, name limit %s, %s""".format(searchfield), - tuple(["%%%s%%" % txt, start, page_len])) + tuple(["%%%s%%" % txt, "%%%s%%" % txt, start, page_len])) diff --git a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py b/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py index 9bdf621a61..492d738448 100644 --- a/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py +++ b/erpnext/schools/report/course_wise_assessment_report/course_wise_assessment_report.py @@ -173,14 +173,16 @@ def get_column(assessment_criteria, total_maximum_score): def get_chart_data(grades, assessment_criteria_list, kounter): grades = sorted(grades) datasets = [] + for grade in grades: - tmp = [] - for ac in assessment_criteria_list: - if grade in kounter[ac]: - tmp.append(kounter[ac][grade]) + tmp = frappe._dict({"values":[], "title": grade}) + for criteria in assessment_criteria_list: + if grade in kounter[criteria]: + tmp["values"].append(kounter[criteria][grade]) else: - tmp.append(0) + tmp["values"].append(0) datasets.append(tmp) + return { "data": { "labels": assessment_criteria_list, From 887285ed1a02f4430ebc8f4a32deea63980405d2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 10 Nov 2017 10:59:07 +0530 Subject: [PATCH 6/8] Update test_assessment_plan.js --- .../schools/doctype/assessment_plan/test_assessment_plan.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js b/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js index b75a41a4a0..d1972a1a8e 100644 --- a/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js +++ b/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js @@ -49,10 +49,6 @@ QUnit.test('Test: Assessment Plan', function(assert){ assert.equal(cur_frm.doc.assessment_plan, assessment_name, 'Assessment correctly set'); assert.equal(cur_frm.doc.student_group, 'test-course-wise-group-2', 'Course for Assessment correctly set'); }, - () => cur_frm.print_doc(), - () => frappe.timeout(1), - () => {assert.ok($('.btn-print-print').is(':visible'), "Print Format Available");}, - () => done() ]); -}); \ No newline at end of file +}); From 8e3da7f70e44c10b9cdb8e7476e3ec25938657d5 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 10 Nov 2017 10:59:17 +0530 Subject: [PATCH 7/8] Update test_assessment_plan.js --- erpnext/schools/doctype/assessment_plan/test_assessment_plan.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js b/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js index d1972a1a8e..faa39bf4e6 100644 --- a/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js +++ b/erpnext/schools/doctype/assessment_plan/test_assessment_plan.js @@ -2,7 +2,7 @@ QUnit.module('schools'); QUnit.test('Test: Assessment Plan', function(assert){ - assert.expect(7); + assert.expect(6); let done = assert.async(); let room_name, instructor_name, assessment_name; From 18c8cf965ff60c4a362f274c7839bf26bd7bf778 Mon Sep 17 00:00:00 2001 From: Saurabh Date: Fri, 10 Nov 2017 13:45:04 +0600 Subject: [PATCH 8/8] bumped to version 9.2.8 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 362d8aa423..f8cade95ab 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -4,7 +4,7 @@ import inspect import frappe from erpnext.hooks import regional_overrides -__version__ = '9.2.7' +__version__ = '9.2.8' def get_default_company(user=None): '''Get default company for user'''