diff --git a/erpnext/patches.txt b/erpnext/patches.txt index fd1b74902bd5a0e52ae138f4a77ab0e7a1e7e0a3..69f70cf254cb0337c4f2f896bf93aba3d58c8da7 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -278,6 +278,7 @@ execute:frappe.rename_doc("Report", "Fichier des Ecritures Comptables [FEC]", "F [post_model_sync] execute:frappe.delete_doc_if_exists('Workspace', 'ERPNext Integrations Settings') +erpnext.patches.v14_0.update_posting_datetime_and_dropped_indexes #22-02-2024 erpnext.patches.v14_0.rename_ongoing_status_in_sla_documents #2022-08-19 erpnext.patches.v14_0.delete_einvoicing_doctypes erpnext.patches.v14_0.delete_shopify_doctypes diff --git a/erpnext/patches/v14_0/update_posting_datetime_and_dropped_indexes.py b/erpnext/patches/v14_0/update_posting_datetime_and_dropped_indexes.py new file mode 100644 index 0000000000000000000000000000000000000000..ca126a40a4098995c5a6f64d4333d4d923eb016a --- /dev/null +++ b/erpnext/patches/v14_0/update_posting_datetime_and_dropped_indexes.py @@ -0,0 +1,19 @@ +import frappe + + +def execute(): + frappe.db.sql( + """ + UPDATE `tabStock Ledger Entry` + SET posting_datetime = DATE_FORMAT(timestamp(posting_date, posting_time), '%Y-%m-%d %H:%i:%s') + """ + ) + + drop_indexes() + + +def drop_indexes(): + if not frappe.db.has_index("tabStock Ledger Entry", "posting_sort_index"): + return + + frappe.db.sql_ddl("ALTER TABLE `tabStock Ledger Entry` DROP INDEX `posting_sort_index`")