fix: posting date and time

This commit is contained in:
Rohit Waghchaure
2026-05-13 13:16:00 +05:30
parent 6f9089dd5b
commit fb6c05f186

View File

@@ -11,6 +11,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
@@ -1056,6 +1057,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