diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 94e48ef135d..ab842095412 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -370,3 +370,5 @@ erpnext.patches.v14_0.update_currency_exchange_settings_for_frankfurter erpnext.patches.v14_0.update_stock_uom_in_work_order_item erpnext.patches.v14_0.disable_add_row_in_gross_profit execute:frappe.db.set_single_value("Accounts Settings", "exchange_gain_loss_posting_date", "Payment") +erpnext.patches.v14_0.update_posting_datetime + 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 00000000000..cb28193b74b --- /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 f951ac019f5..636d620fad3 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -631,4 +631,4 @@ 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)