fix(stock): narrow legacy serial ledger lookup by item (#57499)

Filter legacy Stock Ledger Entry lookups by item code so the existing
item and warehouse index can reduce rows scanned during serial valuation.
This commit is contained in:
Sudharsanan Ashok
2026-07-27 21:40:44 +05:30
committed by GitHub
parent 05a15dff71
commit 425191e57e

View File

@@ -75,6 +75,7 @@ class DeprecatedSerialNoValuation:
| (table.serial_no.like("%\n" + serial_no))
| (table.serial_no.like("%\n" + serial_no + "\n%"))
)
& (table.item_code == self.sle.item_code)
& (table.company == self.sle.company)
& (table.warehouse == self.sle.warehouse)
& (table.serial_and_batch_bundle.isnull())