Remove time log, time log batch from Doc Field.
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 07bf0f0..be0013e 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -282,7 +282,7 @@
erpnext.patches.v7_0.convert_timelogbatch_to_timesheet
erpnext.patches.v7_0.convert_timelog_to_timesheet
erpnext.patches.v7_0.move_timelogbatch_from_salesinvoiceitem_to_salesinvoicetimesheet
-erpnext.patches.v7_0.remove_doctypes_and_reports
+erpnext.patches.v7_0.remove_doctypes_and_reports #2016-10-29
erpnext.patches.v7_0.update_maintenance_module_in_doctype
erpnext.patches.v7_0.update_prevdoc_values_for_supplier_quotation_item
erpnext.patches.v7_0.rename_advance_table_fields
diff --git a/erpnext/patches/v7_0/remove_doctypes_and_reports.py b/erpnext/patches/v7_0/remove_doctypes_and_reports.py
index 0a302b1..3c45be4 100644
--- a/erpnext/patches/v7_0/remove_doctypes_and_reports.py
+++ b/erpnext/patches/v7_0/remove_doctypes_and_reports.py
@@ -5,6 +5,21 @@
frappe.db.sql("""delete from `tabDocType`
where name in('Time Log Batch', 'Time Log Batch Detail', 'Time Log')""")
+ frappe.db.sql("""delete from `tabDocField` where parent in ('Time Log', 'Time Log Batch')""")
+ frappe.db.sql("""update `tabCustom Script` set dt = 'Timesheet' where dt = 'Time Log'""")
+
+ for data in frappe.db.sql(""" select label, fieldname from `tabCustom Field` where dt = 'Time Log'""", as_dict=1):
+ custom_field = frappe.get_doc({
+ 'doctype': 'Custom Field',
+ 'label': data.label,
+ 'dt': 'Timesheet Detail',
+ 'fieldname': data.fieldname
+ }).insert(ignore_permissions=True)
+
+ frappe.db.sql("""delete from `tabCustom Field` where dt = 'Time Log'""")
+ frappe.reload_doc('projects', 'doctype', 'timesheet')
+ frappe.reload_doc('projects', 'doctype', 'timesheet_detail')
+
report = "Daily Time Log Summary"
if frappe.db.exists("Report", report):
frappe.delete_doc('Report', report)
\ No newline at end of file