From 1d0a92ee820e72342113c7b4578b2a6af8a746cd Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 3 Feb 2025 15:34:29 +0530 Subject: [PATCH] fix: slow SABB query --- erpnext/stock/serial_batch_bundle.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/erpnext/stock/serial_batch_bundle.py b/erpnext/stock/serial_batch_bundle.py index e56e374963f..e322911ef3c 100644 --- a/erpnext/stock/serial_batch_bundle.py +++ b/erpnext/stock/serial_batch_bundle.py @@ -639,7 +639,6 @@ class BatchNoValuation(DeprecatedBatchNoValuation): parent = frappe.qb.DocType("Serial and Batch Bundle") child = frappe.qb.DocType("Serial and Batch Entry") - sle = frappe.qb.DocType("Stock Ledger Entry") timestamp_condition = "" if self.sle.posting_date: @@ -672,14 +671,6 @@ class BatchNoValuation(DeprecatedBatchNoValuation): & (parent.docstatus == 1) & (parent.is_cancelled == 0) & (parent.type_of_transaction.isin(["Inward", "Outward"])) - & ( - ExistsCriterion( - frappe.qb.from_(sle) - .select(sle.name) - .where((parent.name == sle.serial_and_batch_bundle) & (sle.is_cancelled == 0)) - ) - | (parent.voucher_type == "POS Invoice") - ) ) .groupby(child.batch_no) ) -- GitLab