From 2424aa73d74edcc17dcc41a64f93b01c85fadf73 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Mon, 22 May 2017 13:09:36 +0530 Subject: [PATCH 1/5] Fix translated string in jinja (#8956) --- erpnext/templates/generators/item_group.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/templates/generators/item_group.html b/erpnext/templates/generators/item_group.html index d710cb0739..a2368a4be0 100644 --- a/erpnext/templates/generators/item_group.html +++ b/erpnext/templates/generators/item_group.html @@ -33,14 +33,14 @@
{% if frappe.form_dict.start|int > 0 %} - {{ __("Prev") }} + {{ _("Prev") }} {% endif %} {% if items|length > page_length %} - {{ __("Next") }} + {{ _("Next") }} {% endif %}
{% else %} -
{{ __("No items listed") }}.
+
{{ _("No items listed") }}.
{% endif %} From 552f7ab67805fdaa8496b18d9a2a74e4c70e6cc4 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Tue, 23 May 2017 11:38:57 +0530 Subject: [PATCH 2/5] fix in the patch for merging the student batch and student group (#8961) --- .../merge_student_batch_and_student_group.py | 66 +++++++++++-------- 1 file changed, 39 insertions(+), 27 deletions(-) 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 742457f154..3eb8e80340 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 @@ -11,43 +11,55 @@ def execute(): # for converting student batch into student group frappe.reload_doctype("Student Group") - student_batches = frappe.db.sql('''select name as student_group_name, student_batch_name as batch, - program, academic_year, academic_term from `tabStudent Batch`''', as_dict=1) - for student_batch in student_batches: - # create student batch name if does not exists !! - if student_batch.get("batch") and not frappe.db.exists("Student Batch Name", student_batch.get("batch")): - frappe.get_doc({ - "doctype": "Student Batch Name", - "batch_name": student_batch.get("batch") - }).insert(ignore_permissions=True) + if frappe.db.table_exists("Student Batch"): + student_batches = frappe.db.sql('''select name as student_group_name, student_batch_name as batch, + program, academic_year, academic_term from `tabStudent Batch`''', as_dict=1) - student_batch.update({"doctype":"Student Group", "group_based_on": "Batch"}) - doc = frappe.get_doc(student_batch) - student_list = frappe.db.sql('''select student, student_name, active from `tabStudent Batch Student` - where parent=%s''', (doc.name), as_dict=1) - for i, student in enumerate(student_list): - student.update({"group_roll_number": i+1}) + for student_batch in student_batches: + # create student batch name if does not exists !! + if student_batch.get("batch") and not frappe.db.exists("Student Batch Name", student_batch.get("batch")): + frappe.get_doc({ + "doctype": "Student Batch Name", + "batch_name": student_batch.get("batch") + }).insert(ignore_permissions=True) - if student_list: - doc.extend("students", student_list) + student_batch.update({"doctype":"Student Group", "group_based_on": "Batch"}) + doc = frappe.get_doc(student_batch) - instructor_list = frappe.db.sql('''select instructor, instructor_name from `tabStudent Batch Instructor` - where parent=%s''', (doc.name), as_dict=1) - if instructor_list: - doc.extend("instructors", instructor_list) - doc.save() + if frappe.db.sql("SHOW COLUMNS FROM `tabStudent Batch Student` LIKE 'active'"): + cond = ", active" + 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) + + if student_list: + for i, student in enumerate(student_list): + student.update({"group_roll_number": i+1}) + 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) + if instructor_list: + doc.extend("instructors", instructor_list) + doc.save() # delete the student batch and child-table - frappe.delete_doc("DocType", "Student Batch", force=1) - frappe.delete_doc("DocType", "Student Batch Student", force=1) - frappe.delete_doc("DocType", "Student Batch Instructor", force=1) + if frappe.db.table_exists("Student Batch"): + frappe.delete_doc("DocType", "Student Batch", force=1) + if frappe.db.table_exists("Student Batch Student"): + frappe.delete_doc("DocType", "Student Batch Student", force=1) + if frappe.db.table_exists("Student Batch Instructor"): + frappe.delete_doc("DocType", "Student Batch Instructor", force=1) # delete the student batch creation tool - frappe.delete_doc("DocType", "Student Batch Creation Tool", force=1) + if frappe.db.table_exists("Student Batch Creation Tool"): + frappe.delete_doc("DocType", "Student Batch Creation Tool", force=1) # delete the student batch creation tool - frappe.delete_doc("DocType", "Attendance Tool Student", force=1) + if frappe.db.table_exists("Attendance Tool Student"): + 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") From a68fff470c5131c9773ace781042245e639750a7 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Tue, 23 May 2017 11:39:53 +0530 Subject: [PATCH 3/5] minor fix in student group (#8959) --- erpnext/schools/doctype/student_group/student_group.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/schools/doctype/student_group/student_group.py b/erpnext/schools/doctype/student_group/student_group.py index 81e0ed946f..e86142106e 100644 --- a/erpnext/schools/doctype/student_group/student_group.py +++ b/erpnext/schools/doctype/student_group/student_group.py @@ -33,7 +33,7 @@ class StudentGroup(Document): program_enrollment = get_program_enrollment(self.academic_year, self.academic_term, self.program, self.batch, self.course) students = [d.student for d in program_enrollment] if program_enrollment else None for d in self.students: - if self.group_based_on != "Activity" and d.student not in students and d.active == 1: + if self.group_based_on != "Activity" and students and d.student not in students and d.active == 1: frappe.throw(_("{0} - {1} is not enrolled in the given {2}".format(d.group_roll_number, d.student_name, self.group_based_on))) 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))) From fdc7d7f3dee920166508fc8c20e4a1d141a99a6f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 23 May 2017 12:02:34 +0530 Subject: [PATCH 4/5] Check for active quotations before declaring it as lost (#8969) --- erpnext/crm/doctype/opportunity/opportunity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index 8c695ed4c0..eebf464047 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -75,7 +75,7 @@ class Opportunity(TransactionBase): self.lead = lead_name def declare_enquiry_lost(self,arg): - if not self.has_lost_quotation(): + if not self.has_active_quotation(): frappe.db.set(self, 'status', 'Lost') frappe.db.set(self, 'order_lost_reason', arg) else: From 2ef20a968cdd2c2357008cd004247f9f76954081 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 23 May 2017 12:34:05 +0600 Subject: [PATCH 5/5] bumped to version 8.0.34 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 22180065b3..eb69d19fd3 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe -__version__ = '8.0.33' +__version__ = '8.0.34' def get_default_company(user=None):