By Annor Amapolley on September 28, 2025
Expert

In 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

  1. This method only changes the docstatus field to 2 (Cancelled).
  2. It does not reverse GL Entries or unlink related documents.
  3. 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

  1. Go to System Console in ERPNext.
  2. Navigate: Awesome Bar → System Console
  3. Paste the following code (replace with your Journal Entry ID):

import frappe
frappe.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.")
  1. Tick the “Commit” checkbox at the bottom of the System Console.
  2. This ensures the database changes are saved.
  3. Click Execute.
  4. Refresh the Journal Entry record. It should now show as Cancelled.

📝 Notes

  1. Always attempt a standard cancellation first.
  2. If linked GL Entries still exist, you may need to manually delete them or reconcile balances.
  3. For bulk corrections, consider writing a Server Script or consulting your system administrator.



More articles on Erpnext



More articles on Erpnext
Comments

No comments yet.

Add a comment
Ctrl+Enter to add comment