Forcing Cancellation of a Journal Entry via System Console
By Annor Amapolley on September 28, 2025
ExpertIn ERPNext, Journal Entries are usually cancelled through the standard Cancel button on the form. This ensures proper reversal of General Ledger (GL) entries and maintains accounting integrity.
However, there may be rare cases where a Journal Entry refuses to cancel due to broken links, validation errors, or corrupted references. In such cases, administrators can force-cancel the document using the System Console.
⚠️ Important Warning
- This method only changes the
docstatusfield to 2 (Cancelled). - It does not reverse GL Entries or unlink related documents.
- Use this only when you are sure the Journal Entry should be marked as cancelled and you understand the accounting impact.
✅ Steps to Force Cancel a Journal Entry
- Go to System Console in ERPNext.
- Navigate: Awesome Bar → System Console
- Paste the following code (replace with your Journal Entry ID):
import frappefrappe.db.set_value("Journal Entry", "ACC-JV-2025-01496", "docstatus", 2)frappe.db.commit()print("Journal Entry ACC-JV-2025-01496 has been marked as Cancelled.")
- Tick the “Commit” checkbox at the bottom of the System Console.
- This ensures the database changes are saved.
- Click Execute.
- Refresh the Journal Entry record. It should now show as Cancelled.
📝 Notes
- Always attempt a standard cancellation first.
- If linked GL Entries still exist, you may need to manually delete them or reconcile balances.
- For bulk corrections, consider writing a Server Script or consulting your system administrator.
Was this article helpful?
More articles on Erpnext