From 48dbb6f66793522ebf5aa5d3e0336685bf5dfba7 Mon Sep 17 00:00:00 2001 From: Mihir Kandoi Date: Tue, 14 Oct 2025 23:37:45 +0530 Subject: [PATCH] fix(stock): remove filter from query --- erpnext/controllers/stock_controller.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 2596a61269..c0c42f80b4 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -544,8 +544,13 @@ class StockController(AccountsController): break elif row.batch_no: - batches = frappe.get_all( - "Serial and Batch Entry", fields=["batch_no"], filters={"parent": row.serial_and_batch_bundle} + batches = sorted( + frappe.get_all( + "Serial and Batch Entry", + filters={"parent": row.serial_and_batch_bundle}, + pluck="batch_no", + distinct=True, + ) ) batches = sorted([d.batch_no for d in batches]) -- GitLab