From cf92be88b7873135344c9715ef45f5031cb2c9ca Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Wed, 31 May 2017 08:51:12 +0100 Subject: [PATCH 1/6] [minor] fixes typo (#9093) --- erpnext/stock/doctype/material_request/material_request_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/material_request/material_request_list.js b/erpnext/stock/doctype/material_request/material_request_list.js index b6ceeac85c..6611a2053d 100644 --- a/erpnext/stock/doctype/material_request/material_request_list.js +++ b/erpnext/stock/doctype/material_request/material_request_list.js @@ -6,7 +6,7 @@ frappe.listview_settings['Material Request'] = { } else if(doc.docstatus==1 && flt(doc.per_ordered, 2) == 0) { return [__("Pending"), "orange", "per_ordered,=,0"]; } else if(doc.docstatus==1 && flt(doc.per_ordered, 2) < 100) { - return [__("Partially ordred"), "yellow", "per_ordered,<,100"]; + return [__("Partially ordered"), "yellow", "per_ordered,<,100"]; } else if(doc.docstatus==1 && flt(doc.per_ordered, 2) == 100) { if (doc.material_request_type == "Purchase") { return [__("Ordered"), "green", "per_ordered,=,100"]; From f02c82aeca4e2c2a5370c72e02004bb19393ef19 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Thu, 1 Jun 2017 13:08:27 +0530 Subject: [PATCH 2/6] Fixes in the patch (#9027) * fix in the patch * new patch for student groups * changes in the merge student batch patch --- .../merge_student_batch_and_student_group.py | 10 ++--- ...ate_student_groups_from_student_batches.py | 38 +++++++++++++++++++ 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 erpnext/patches/v8_0/update_student_groups_from_student_batches.py diff --git a/erpnext/patches/v8_0/merge_student_batch_and_student_group.py b/erpnext/patches/v8_0/merge_student_batch_and_student_group.py index 3eb8e80340..7cfdf60303 100644 --- a/erpnext/patches/v8_0/merge_student_batch_and_student_group.py +++ b/erpnext/patches/v8_0/merge_student_batch_and_student_group.py @@ -8,9 +8,9 @@ from frappe.model.mapper import get_mapped_doc def execute(): - # for converting student batch into student group - frappe.reload_doctype("Student Group") + for doctype in ["Student Group", "Student Group Student", "Student Group Instructor", "Student Attendance"]: + frappe.reload_doc("schools", "doctype", doctype) if frappe.db.table_exists("Student Batch"): student_batches = frappe.db.sql('''select name as student_group_name, student_batch_name as batch, @@ -32,7 +32,7 @@ def execute(): else: cond = " " student_list = frappe.db.sql('''select student, student_name {cond} from `tabStudent Batch Student` - where parent=%s'''.format(cond=cond), (doc.name), as_dict=1) + where parent=%s'''.format(cond=cond), (doc.student_group_name), as_dict=1) if student_list: for i, student in enumerate(student_list): @@ -40,7 +40,7 @@ def execute(): doc.extend("students", student_list) instructor_list = frappe.db.sql('''select instructor, instructor_name from `tabStudent Batch Instructor` - where parent=%s''', (doc.name), as_dict=1) + where parent=%s''', (doc.student_group_name), as_dict=1) if instructor_list: doc.extend("instructors", instructor_list) doc.save() @@ -62,8 +62,6 @@ def execute(): frappe.delete_doc("DocType", "Attendance Tool Student", force=1) # change the student batch to student group in the student attendance - frappe.reload_doctype("Student Attendance") - table_columns = frappe.db.get_table_columns("Student Attendance") if "student_batch" in table_columns: rename_field("Student Attendance", "student_batch", "student_group") diff --git a/erpnext/patches/v8_0/update_student_groups_from_student_batches.py b/erpnext/patches/v8_0/update_student_groups_from_student_batches.py new file mode 100644 index 0000000000..ae24fe4a14 --- /dev/null +++ b/erpnext/patches/v8_0/update_student_groups_from_student_batches.py @@ -0,0 +1,38 @@ +# Copyright (c) 2017, Frappe and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.utils.rename_field import * +from frappe.model.mapper import get_mapped_doc + + +def execute(): + if frappe.db.table_exists("Student Batch"): + student_batches = frappe.db.sql('''select name from `tabStudent Batch`''', as_dict=1) + + for student_batch in student_batches: + if frappe.db.exists("Student Group", student_batch.get("name")): + student_group = frappe.get_doc("Student Group", student_batch.get("name")) + + if frappe.db.table_exists("Student Batch Student"): + current_student_list = frappe.db.sql_list('''select student from `tabStudent Group Student` + where parent=%s''', (student_group.name)) + batch_student_list = frappe.db.sql_list('''select student from `tabStudent Batch Student` + where parent=%s''', (student_group.name)) + + student_list = list(set(batch_student_list)-set(current_student_list)) + if student_list: + student_group.extend("students", [{"student":d} for d in student_list]) + + if frappe.db.table_exists("Student Batch Instructor"): + current_instructor_list = frappe.db.sql_list('''select instructor from `tabStudent Group Instructor` + where parent=%s''', (student_group.name)) + batch_instructor_list = frappe.db.sql_list('''select instructor from `tabStudent Batch Instructor` + where parent=%s''', (student_group.name)) + + instructor_list = list(set(batch_instructor_list)-set(current_instructor_list)) + if instructor_list: + student_group.extend("instructors", [{"instructor":d} for d in instructor_list]) + + student_group.save() From e4b3a67e742302c21ad9f38511bf6a41b500e4b6 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Jun 2017 16:47:30 +0530 Subject: [PATCH 3/6] Rate validation in return entry --- erpnext/controllers/sales_and_purchase_return.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/sales_and_purchase_return.py b/erpnext/controllers/sales_and_purchase_return.py index d2f894a6a4..45447d76ec 100644 --- a/erpnext/controllers/sales_and_purchase_return.py +++ b/erpnext/controllers/sales_and_purchase_return.py @@ -144,7 +144,8 @@ def get_ref_item_dict(valid_items, ref_item_row): })) item_dict = valid_items[ref_item_row.item_code] item_dict["qty"] += ref_item_row.qty - item_dict["rate"] = ref_item_row.get("rate", 0) + if ref_item_row.get("rate", 0) > item_dict["rate"]: + item_dict["rate"] = ref_item_row.get("rate", 0) if ref_item_row.parenttype in ['Purchase Invoice', 'Purchase Receipt']: item_dict["received_qty"] += ref_item_row.received_qty From 0b8f920e22c910eaf2491f4c5bf7a9dab8091aa7 Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Thu, 1 Jun 2017 18:56:39 +0530 Subject: [PATCH 4/6] [minor] install node v7 (#9109) --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 9cad59fcc6..8f2febd53e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ before_install: install: - sudo apt-get purge -y mysql-common mysql-server mysql-client + - nvm install v7.10.0 # - 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 --bench-branch develop - wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py From 7f2513f7a148c419fd0ab6896556fc1806b09626 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Thu, 1 Jun 2017 18:57:34 +0530 Subject: [PATCH 5/6] [Fix] Employees working on a holiday report's date filter not working (#9108) --- .../employees_working_on_a_holiday.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/erpnext/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.py b/erpnext/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.py index 60bb02cdb3..59f56d7345 100644 --- a/erpnext/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.py +++ b/erpnext/hr/report/employees_working_on_a_holiday/employees_working_on_a_holiday.py @@ -25,11 +25,10 @@ def get_columns(): ] def get_employees(filters): - holiday_filter = {"holiday_date": (">=", filters.from_date), - "holiday_date": ("<=", filters.to_date)} + holiday_filter = [["holiday_date", ">=", filters.from_date], ["holiday_date", "<=", filters.to_date]] if filters.holiday_list: - holiday_filter["parent"] = filters.holiday_list - + holiday_filter.append(["parent", "=", filters.holiday_list]) + holidays = frappe.get_all("Holiday", fields=["holiday_date", "description"], filters=holiday_filter) From 1091a2549121e5be58260de7b322fc7932618135 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 1 Jun 2017 19:39:36 +0600 Subject: [PATCH 6/6] bumped to version 8.0.43 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index e6f65d0bb2..915d97bb4f 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.0.42' +__version__ = '8.0.43' def get_default_company(user=None):