From 8de7abbb6c1d22fc0976e30c6d8a0f5faa09ccf1 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 18 Feb 2025 13:56:00 +0530 Subject: [PATCH 1/2] fix: millisecond issue for posting datetime --- erpnext/patches.txt | 7 ++++++- erpnext/patches/v14_0/update_posting_datetime.py | 10 ++++++++++ erpnext/stock/utils.py | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 erpnext/patches/v14_0/update_posting_datetime.py diff --git a/erpnext/patches.txt b/erpnext/patches.txt index b28d0f23b7..f012b38847 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -416,4 +416,9 @@ erpnext.patches.v15_0.update_task_assignee_email_field_in_asset_maintenance_log erpnext.patches.v14_0.update_stock_uom_in_work_order_item erpnext.patches.v15_0.enable_allow_existing_serial_no erpnext.patches.v15_0.update_asset_status_to_work_in_progress -erpnext.patches.v15_0.rename_manufacturing_settings_field \ No newline at end of file +erpnext.patches.v15_0.rename_manufacturing_settings_field +erpnext.patches.v15_0.migrate_checkbox_to_select_for_reconciliation_effect +erpnext.patches.v15_0.sync_auto_reconcile_config +execute:frappe.db.set_single_value("Accounts Settings", "exchange_gain_loss_posting_date", "Payment") +erpnext.patches.v14_0.disable_add_row_in_gross_profit +erpnext.patches.v14_0.update_posting_datetime \ No newline at end of file diff --git a/erpnext/patches/v14_0/update_posting_datetime.py b/erpnext/patches/v14_0/update_posting_datetime.py new file mode 100644 index 0000000000..cb28193b74 --- /dev/null +++ b/erpnext/patches/v14_0/update_posting_datetime.py @@ -0,0 +1,10 @@ +import frappe + + +def execute(): + frappe.db.sql( + """ + UPDATE `tabStock Ledger Entry` + SET posting_datetime = timestamp(posting_date, posting_time) + """ + ) diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 25434a3de3..5de3bda52d 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -666,7 +666,7 @@ def get_combine_datetime(posting_date, posting_time): if isinstance(posting_time, datetime.timedelta): posting_time = (datetime.datetime.min + posting_time).time() - return datetime.datetime.combine(posting_date, posting_time).replace(microsecond=0) + return datetime.datetime.combine(posting_date, posting_time) @frappe.request_cache -- GitLab From 6ccc9fea815faf9af4d77e6e05d52826f8a6b0e5 Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Thu, 20 Feb 2025 07:56:41 +0000 Subject: [PATCH 2/2] fix: remove patches from v5 --- erpnext/patches.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/erpnext/patches.txt b/erpnext/patches.txt index f012b38847..bee3fa68ab 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -417,8 +417,4 @@ erpnext.patches.v14_0.update_stock_uom_in_work_order_item erpnext.patches.v15_0.enable_allow_existing_serial_no erpnext.patches.v15_0.update_asset_status_to_work_in_progress erpnext.patches.v15_0.rename_manufacturing_settings_field -erpnext.patches.v15_0.migrate_checkbox_to_select_for_reconciliation_effect -erpnext.patches.v15_0.sync_auto_reconcile_config -execute:frappe.db.set_single_value("Accounts Settings", "exchange_gain_loss_posting_date", "Payment") -erpnext.patches.v14_0.disable_add_row_in_gross_profit erpnext.patches.v14_0.update_posting_datetime \ No newline at end of file -- GitLab