diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 430ebaf749ffd6ba7666017516f9d781e6354d47..556e83d0773156527ef8ed5c67088b080e423179 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -279,6 +279,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`")