diff --git a/erpnext/patches.txt b/erpnext/patches.txt index bb76f948f3a..cb10fcce1c4 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -393,3 +393,4 @@ 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.v15_0.set_difference_amount_in_asset_value_adjustment +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 6369562a62d..f1055b114cf 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -663,4 +663,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)