From a5de83351e02bc2168da71bb3fe013968cdda6de Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 13 Sep 2016 12:36:37 +0530 Subject: [PATCH] [Fix] Timesheet patch --- erpnext/patches/v7_0/remove_doctypes_and_reports.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/erpnext/patches/v7_0/remove_doctypes_and_reports.py b/erpnext/patches/v7_0/remove_doctypes_and_reports.py index 978c363562..0a302b1441 100644 --- a/erpnext/patches/v7_0/remove_doctypes_and_reports.py +++ b/erpnext/patches/v7_0/remove_doctypes_and_reports.py @@ -1,9 +1,10 @@ import frappe def execute(): - for doctype in ['Time Log Batch', 'Time Log Batch Detail', 'Time Log']: - frappe.delete_doc('DocType', doctype) - + if frappe.db.table_exists("Time Log"): + frappe.db.sql("""delete from `tabDocType` + where name in('Time Log Batch', 'Time Log Batch Detail', 'Time Log')""") + report = "Daily Time Log Summary" if frappe.db.exists("Report", report): frappe.delete_doc('Report', report) \ No newline at end of file