A purchase receipt that opens empty
Picture a purchase invoice that arrives before the goods do. Someone creates it with Update Stock ticked, saves it, then unticks Update Stock and submits. Later the warehouse clicks Create, then Purchase Receipt, to book the goods in.
The items table comes up empty.
Nothing is wrong with the supplier or the item. The invoice still holds a receipt quantity from the first save, and ERPNext reads that as goods already received.
Two fields that track what has arrived
A Purchase Invoice can bring stock in on its own. With Update Stock on, the invoice posts the stock movement and no Purchase Receipt is needed. With it off, the invoice is only a bill, and the goods come in on a receipt.
The diagram below shows how the three documents connect.
ERPNext keeps the receipt bookkeeping on each Purchase Invoice Item row:
-
received_qty(labelled Received Qty) is read-only and not copied on amend. With Update Stock on, it is set to accepted plus rejected quantity. -
rejected_qty(labelled Rejected Qty) holds the part of the delivery the warehouse refused.
The trouble starts when Update Stock changes after the first save. Those two numbers stay where they were.
What v16.61 changes
The fix is PR #68861, a backport of #68338. It merged into version-16-hotfix on 22 November 2026 and ships in v16.61.0, released 25 November. The change lives in purchase_invoice.py and runs during validate():
- A new method,
reset_receipt_qty, runs after the parent validate call. - If Update Stock is off, it walks the item rows.
- Rows with no
pr_detaillink getreceived_qtyandrejected_qtyset to 0. - Rows linked to a Purchase Receipt keep their values, because the receipt owns those.
Because the check sits in validate(), it also applies to saves through the REST API and Data Import, not only the form. That matters if an integration writes invoices for you.
The tests show the intended behaviour. A new test, test_purchase_receipt_from_invoice_after_update_stock_turned_off, creates an invoice with a quantity of 5, turns Update Stock off, submits it, and asserts that a Purchase Receipt built from it has a quantity of 5. An older test that expected -10 in this situation now expects 0.
The tradeoff: validate only runs on save
The reset happens when a document is saved. A submitted invoice that already holds a stale value is not corrected by the upgrade alone, and we would not assume it is.
Before you rely on the fix, query for those rows on a staging copy:
SELECT pii.parent, pii.item_code, pii.received_qty FROM `tabPurchase Invoice Item` pii JOIN `tabPurchase Invoice` pi ON pi.name = pii.parent WHERE pi.docstatus = 1 AND pi.update_stock = 0 AND pii.pr_detail IS NULL AND pii.received_qty > 0; Treat the result as a review list, not a bulk update. Correcting a submitted invoice is an accounting decision, and your finance team should make it.
A related PR, #68285, touches the same area. Its description says only one of the two PRs should carry the server-side part. Check the purchase_invoice.py in your own build instead of trusting the release list alone.
The takeaway
Update Stock is a state, not just a checkbox. Changing it after save leaves numbers behind. v16.61 clears those numbers on the next save, which is the right behaviour. The gap is older submitted invoices, so find them before a warehouse does.
Have you hit a purchase receipt that opened empty? Did you fix the invoice, or the receipt?
Have questions about implementing this? Drop us a line — we're happy to help.


