From 580f39a12c3cf25536cfbece66a0fe11b2379059 Mon Sep 17 00:00:00 2001 From: Manas Solanki Date: Tue, 12 Sep 2017 15:49:36 +0530 Subject: [PATCH] check the instructor table before querying (#10754) --- .../patches/v8_0/merge_student_batch_and_student_group.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 d30b35e909..aacd97b2d9 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 @@ -40,8 +40,10 @@ def execute(): 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.student_group_name), as_dict=1) + instructor_list = None + if frappe.db.table_exists("Student Batch Instructor"): + instructor_list = frappe.db.sql('''select instructor, instructor_name from `tabStudent Batch Instructor` + where parent=%s''', (doc.student_group_name), as_dict=1) if instructor_list: doc.extend("instructors", instructor_list) doc.save()