diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 9351423541b..9623b36d2c9 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -1366,8 +1366,10 @@ class StockController(AccountsController): continue key = (row.batch_no, row.warehouse) - outstanding_qty[key] += flt(row.qty) - flt(row.delivered_qty) - reservations[key].append(row) + outstanding = flt(row.qty) - flt(row.delivered_qty) + outstanding_qty[key] += outstanding + if outstanding > 0: + reservations[key].append(row) for (batch_no, warehouse), reserved_qty in outstanding_qty.items(): if reserved_qty <= 0: