Files
erpnext/erpnext
Mihir Kandoi 461001ac88 refactor(stock): remove dead get_batches() in batch.py
batch.get_batches(item_code, warehouse, ...) was added by #55647 and has no callers
anywhere in erpnext, frappe, or payments (not whitelisted, not referenced from JS/hooks).
It is also obsolete: it joins Stock Ledger Entry on `batch_no`, which the Serial and
Batch Bundle system no longer populates, so it returns nothing even on MariaDB. Its
query was additionally Postgres-invalid (GROUP BY batch_id with ORDER BY expiry_date/
creation -> GroupingError, since batch_id is not the primary key).

Remove the dead function (and its now-unused CurDate/Sum import) rather than fix a query
that nothing can reach. Live batch-quantity lookups go through get_batch_qty() /
get_auto_batch_nos(), which use the bundle model.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
(cherry picked from commit 345cbc97e1)

# Conflicts:
#	erpnext/stock/doctype/batch/batch.py
2026-06-21 07:17:56 +00:00
..
2026-06-20 20:00:29 +05:30
2026-01-13 10:50:15 +05:30
2022-03-28 18:52:46 +05:30
2022-04-28 12:02:54 +05:30
2022-03-28 18:52:46 +05:30