Merge pull request #6480 from rohitwaghchaure/patch_fix_timesheet
Remove time log, time log batch from Doc Field.
This commit is contained in:
commit
a82358bb98
@ -282,7 +282,7 @@ execute:frappe.reload_doc('projects', 'doctype', 'project_user')
|
||||
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
|
||||
|
@ -5,6 +5,21 @@ def execute():
|
||||
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)
|
Loading…
Reference in New Issue
Block a user