fix: keyerror posting_time (backport #42452) (#42460)

fix: keyerror posting_time (#42452)

fix: keyerror: posting_time
(cherry picked from commit 06e2d7265c)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-07-25 06:48:10 +05:30
committed by GitHub
parent a24fe951ed
commit 2d2140aad0

View File

@@ -1588,9 +1588,11 @@ def get_stock_ledger_entries(
if not previous_sle.get("posting_date"):
previous_sle["posting_datetime"] = "1900-01-01 00:00:00"
else:
previous_sle["posting_datetime"] = get_combine_datetime(
previous_sle["posting_date"], previous_sle["posting_time"]
)
posting_time = previous_sle.get("posting_time")
if not posting_time:
posting_time = "00:00:00"
previous_sle["posting_datetime"] = get_combine_datetime(previous_sle["posting_date"], posting_time)
if operator in (">", "<=") and previous_sle.get("name"):
conditions += " and name!=%(name)s"