diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 1fa509b524b820174842c27eb55e3b12b443a4c1..bb74eb8cdd542e6d8c81a2cdf503dd88a2027152 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -439,4 +439,5 @@ 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 \ No newline at end of file +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 0000000000000000000000000000000000000000..cb28193b74b6d1efb2ca0fa0d78d507874be344f --- /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 1a6a209ab18e72ebd73fc485042640fdcbf7b521..8426e425cd4b6914015260f4e7eda10533f6a5e4 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -662,7 +662,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