From ab090295d9aecbb6719db99d4713d850a63961a0 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Wed, 13 May 2026 13:16:00 +0530 Subject: [PATCH 1/3] fix: posting date and time (cherry picked from commit fb6c05f186c91b117eb9e783e8df5607dc4f09b3) (cherry picked from commit 1c44c60dbdba6cd4a8d5c03fe231e45af0b1acc1) --- erpnext/stock/serial_batch_bundle.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index 4a47144ecf1..8687157699f 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -13,6 +13,7 @@ from erpnext.stock.deprecated_serial_batch import ( DeprecatedBatchNoValuation, DeprecatedSerialNoValuation, ) +from erpnext.stock.utils import get_combine_datetime from erpnext.stock.valuation import round_off_if_near_zero CONSUMED_SERIAL_NO_STOCK_ENTRY_PURPOSES = ( @@ -1069,6 +1070,10 @@ class SerialBatchCreation: self.__dict__.update(item_details) def set_other_details(self): + if not self.get("posting_datetime"): + if self.get("posting_date") and self.get("posting_time"): + self.posting_datetime = get_combine_datetime(self.posting_date, self.posting_time) + if not self.get("posting_datetime"): self.posting_datetime = now() self.__dict__["posting_datetime"] = self.posting_datetime From 927360dd1d30045a40a0b9d86ece5b7d2cf35feb Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 13 May 2026 14:05:55 +0530 Subject: [PATCH 2/3] chore: fixed test case (cherry picked from commit c740f77a6fe7f53c89034f1b2b35c82c67310d96) (cherry picked from commit f4e66914c6ee9835935b60ee766a1cf936f0b5a2) --- erpnext/stock/serial_batch_bundle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index 8687157699f..42e4df2d502 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -13,7 +13,6 @@ from erpnext.stock.deprecated_serial_batch import ( DeprecatedBatchNoValuation, DeprecatedSerialNoValuation, ) -from erpnext.stock.utils import get_combine_datetime from erpnext.stock.valuation import round_off_if_near_zero CONSUMED_SERIAL_NO_STOCK_ENTRY_PURPOSES = ( @@ -1070,6 +1069,7 @@ class SerialBatchCreation: self.__dict__.update(item_details) def set_other_details(self): + from erpnext.stock.utils import get_combine_datetime if not self.get("posting_datetime"): if self.get("posting_date") and self.get("posting_time"): self.posting_datetime = get_combine_datetime(self.posting_date, self.posting_time) From b79ec7cbdd1c915cfd9e0582df034b2bf974ce19 Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Wed, 13 May 2026 18:50:09 +0530 Subject: [PATCH 3/3] chore: fix linter issue (cherry picked from commit 3c993377aaa7fb9cf3349565553515d1d7e0b735) (cherry picked from commit 21ada7799cdfff258856384dddfd604db7eab0a6) --- erpnext/stock/serial_batch_bundle.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index 42e4df2d502..633867dcc79 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -1070,6 +1070,7 @@ class SerialBatchCreation: def set_other_details(self): from erpnext.stock.utils import get_combine_datetime + if not self.get("posting_datetime"): if self.get("posting_date") and self.get("posting_time"): self.posting_datetime = get_combine_datetime(self.posting_date, self.posting_time)