Fix the insufficient stock error ​

When you submit a Delivery Note, a Stock Entry, or another outgoing transaction, ERPNext can stop with a message like this:

text
5 units of Item A needed in Stores on 01-04-2026 10:00:00 for Delivery Note DN-0012 to complete this transaction.

The message can appear even when the warehouse has the stock today.

Cause ​

ERPNext checks stock on the Posting Date and Posting Time of the transaction, not on today's date. If the transaction is backdated, and the stock arrived after that date and time, the warehouse did not have the stock at the moment of the transaction.

Fix ​

  1. Open the Stock Ledger report for the item and warehouse. Find the posting date and time of the receipt that brought the stock in.
  2. Open the transaction that shows the error. Select Edit Posting Date and Time.
  3. Set a Posting Date and Posting Time after the receipt, then submit.

If the stock should have been there on the original date, post the missing receipt with an earlier posting date and time instead.

WARNING

Do not turn on Allow negative stock in Stock Settings to get past this error. Negative stock leads to wrong valuation and adjustment entries. See Why negative stock creates stock adjustment entries.