From 2907881dfb18e8c78e2b84d823d1389ccb74dfea Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 7 Oct 2016 16:07:11 +0530 Subject: [PATCH] Update update_timesheet_communications --- erpnext/patches/v7_0/update_timesheet_communications | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/patches/v7_0/update_timesheet_communications b/erpnext/patches/v7_0/update_timesheet_communications index 01d32102480..ac87d826982 100644 --- a/erpnext/patches/v7_0/update_timesheet_communications +++ b/erpnext/patches/v7_0/update_timesheet_communications @@ -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 ts.name AS name, tl.name AS timelogname, tl.modified AS modified, tl.modified_by AS modified_by, tl.creation AS creation, tl.owner AS owner FROM @@ -13,6 +13,10 @@ def execute(): AND tl.docstatus < 2""", as_dict=1) for data in timesheet: + frappe.db.sql(""" update `tabTimesheet` set creation = %(creation)s, + owner = %(owner)s, modified = %(modified)s, modified_by = %(modified_by)s + where name = %(name)s""", data) + frappe.db.sql(""" update tabCommunication