Merge pull request #6353 from rohitwaghchaure/patch_fix_for_timesheet

[Fix] Timesheet patch
diff --git a/erpnext/patches/v7_0/remove_doctypes_and_reports.py b/erpnext/patches/v7_0/remove_doctypes_and_reports.py
index 978c363..0a302b1 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