diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index b638f08ed9b1..0b4f30fb968f 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -1456,7 +1456,7 @@ def get_next_stock_reco(kwargs): ) if kwargs.get("batch_no"): - query.where(sle.batch_no == kwargs.get("batch_no")) + query = query.where(sle.batch_no == kwargs.get("batch_no")) return query.run(as_dict=True)