Delete and restore documents
You can delete masters, such as Items and Customers, and transactions, such as Sales Orders. ERPNext keeps a copy of each deleted document, so you can restore it later.
Prerequisites
- The Delete permission on the DocType.
- The System Manager role, to restore a deleted document.
Delete a document
- Open the document.
- If the document is submitted, select Cancel first. You cannot delete a submitted document.
- Open the menu, and select Delete. Confirm.
If submitted documents link to the document, ERPNext does not let you cancel or delete it. Cancel the linked documents first. For example, cancel the Sales Invoice before you cancel its Sales Order.
Delete many documents
- Open the list of the DocType.
- Select the documents.
- To cancel submitted documents, select Actions > Cancel.
- Select Actions > Delete.
Restore a deleted document
- Open the Deleted Document list.
- Find the document. Filter by Deleted DocType, or search by Deleted Name, for example
PUR-ORD-2019-00019. - Open it, and check the Data field to make sure that it is the right document.
- Select Restore.
ERPNext restores the document as a draft. If the document was cancelled before you deleted it, ERPNext gives it a new name from its naming series. New Name shows the restored document's name. Select Open to open it.
ERPNext marks restored documents with Restored in the Deleted Document list.