From 142f14dd5cdf68d56216a44f4687f2f61d26a05a Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 2 Sep 2016 14:47:05 +0530 Subject: [PATCH] Migrate employee field to timesheet only if it exists in time log --- erpnext/patches/v7_0/update_missing_employee_in_timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/patches/v7_0/update_missing_employee_in_timesheet.py b/erpnext/patches/v7_0/update_missing_employee_in_timesheet.py index 57f518921b..54d492b265 100644 --- a/erpnext/patches/v7_0/update_missing_employee_in_timesheet.py +++ b/erpnext/patches/v7_0/update_missing_employee_in_timesheet.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals import frappe def execute(): - if frappe.db.table_exists("Time Log"): + if frappe.db.table_exists("Time Log") and "employee" in frappe.db.get_table_columns("Time Log"): timesheet = frappe.db.sql("""select tl.employee as employee, ts.name as name, tl.modified as modified, tl.modified_by as modified_by, tl.creation as creation, tl.owner as owner from