From 90a77030a71fc7697f05a274a09bf543682d8023 Mon Sep 17 00:00:00 2001 From: s-aga-r Date: Fri, 30 Jun 2023 12:34:39 +0530 Subject: [PATCH] fix: add filter for disabled batch --- .../serial_and_batch_bundle/serial_and_batch_bundle.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 57bb71ef1e..2776a74c2d 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 @@ -1312,7 +1312,10 @@ def get_available_batches(kwargs): batch_ledger.warehouse, Sum(batch_ledger.qty).as_("qty"), ) - .where(((batch_table.expiry_date >= today()) | (batch_table.expiry_date.isnull()))) + .where( + (batch_table.disabled == 0) + & ((batch_table.expiry_date >= today()) | (batch_table.expiry_date.isnull())) + ) .where(stock_ledger_entry.is_cancelled == 0) .groupby(batch_ledger.batch_no, batch_ledger.warehouse) )