fix: ignore expired batch for pick list

(cherry picked from commit 786db3d0fa)
This commit is contained in:
Dany Robert
2025-01-30 19:34:06 +05:30
committed by Mergify
parent 4b345cf495
commit 2a258c1629

View File

@@ -2471,6 +2471,9 @@ def get_stock_ledgers_batches(kwargs):
else:
query = query.where(stock_ledger_entry[field] == kwargs.get(field))
if not kwargs.get("for_stock_levels"):
query = query.where((batch_table.expiry_date >= today()) | (batch_table.expiry_date.isnull()))
if kwargs.get("posting_date"):
if kwargs.get("posting_time") is None:
kwargs.posting_time = nowtime()