From 87b4a2e1a68c2e5b36f9e8059f6a806365206085 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Thu, 30 Jan 2025 19:34:06 +0530 Subject: [PATCH] fix: ignore expired batch for pick list (cherry picked from commit 786db3d0fae6daf010554566e0ceb352b68747a8) --- .../doctype/serial_and_batch_bundle/serial_and_batch_bundle.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py index 42683d6a3b8..1874d385f40 100644 --- a/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py +++ b/erpnext/stock/doctype/serial_and_batch_bundle/serial_and_batch_bundle.py @@ -2442,6 +2442,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() -- GitLab