Alternative Posted + Lock/Unlock Workflow For Submittable Doctypes

Feature Request: Alternative Posted + Lock/Unlock Workflow

Problem

ERPNext currently uses:

Draft → Submit → Cancel → Amend → New Document

Once a document is submitted, correcting even a small mistake generally requires cancellation and amendment. Every amendment creates another document/version.

For example, if a Purchase Receipt has:

  • Wrong item
  • Wrong quantity
  • Wrong rate

the user may have to cancel and amend the document multiple times.

One real transaction can therefore become:

PR-00001 → PR-00001-1 → PR-00001-2 → PR-00001-3

Or

PR-00001 → PR-00002 → PR-00003 → PR-00004

At scale, this creates unnecessary document proliferation and makes reports, reconciliation and document history more complicated.

Proposed Solution

Please consider providing an alternative document lifecycle for submittable DocTypes:

Draft → Posted → Locked

and, for authorized users:

Locked → Unlocked → Edit → Lock

This would give authorized users the flexibility to correct genuine data-entry mistakes after submission, such as incorrect item selection, item name or description, quantity, unit of measure, unit price/rate, warehouse, posting date, delivery date, supplier or customer reference, tax details, remarks, project/cost center, and other permitted transaction details, without having to cancel and create a new amended document for every correction.

Any changes that affect the General Ledger, Stock Ledger, taxes, valuation, outstanding amounts, or other accounting/stock-related records should remain subject to the appropriate system validations and controls. The purpose is not to bypass accounting controls, but to provide an authorized and auditable way to make legitimate corrections without unnecessarily creating a new amended document.

“We are not asking to bypass accounting controls; we are asking for a controlled alternative to Cancel & Amend.”

The existing Cancel/Amend workflow can remain available for companies that require strict immutable documents.

Why “Posted”?

Instead of using Submit, the system could optionally use terminology such as:

Draft → Posted → Locked

“Posted” clearly represents that the transaction has been finalized/posted to the system, while Lock/Unlock controls whether the document can be edited.

This separates two different concepts:

  • Posted = business/accounting status
  • Locked/Unlocked = editing status

Example

Employee creates:

Purchase Receipt PR-00001

→ Draft
→ Posted
→ Automatically Locked

Manager discovers the quantity is wrong:

Unlock → Change Qty 10 → 12 → Save → Lock

The document remains:

PR-00001

instead of creating:

PR-00001-1 OR PR-00002

If another correction is required later, the same process can be repeated while maintaining the complete Version/Audit history.

Permissions

Unlocking should be permission-controlled, e.g.:

Employee: Cannot Unlock
Manager: Can Unlock
Administrator: Full access

An optional Unlock Reason could also be recorded in the audit trail.

Important

This should be an alternative workflow, not a replacement for the existing Cancel/Amend process.

Some businesses need strict immutable documents, while many SMEs need controlled correction of genuine data-entry mistakes without creating multiple amended documents.

The goal is:

Better auditability without unnecessary document proliferation.

This concept could potentially apply to Purchase Receipt, Purchase Invoice, Sales Order, Sales Invoice, Delivery Note, Purchase Order, Stock Entry, Payment Entry, Landed Cost Voucher and other submittable DocTypes.

Supporting Photos:

Invoice Layout
Image

Can be Edit
Image

Lock Invoice
Image

Lock Reason
Image

Cannot Edit
Image

Lock Visibility on hover on lock icon
Image

Unlock Invoice
Image

Unlock Reason
Image

Can be Edit
Image

For More Info please see below lin:

Hi there,

What you’re describing is exactly what workflows are designed to do.

The reason for blocking edits to submitted documents is only partly about controls. Far more important, the submitted docstatus exists to ensure data integrity. If you change a document after it has been submitted, there’s a very real risk that it will no longer align with downstream documents.

true but then a lot of the current accounting softwares like busy/ tally allow this editing without data integrity issues. they have audit trail as well, but without the -1, -2 numbering.

Is the request - basically seeking to “Unsubmit” a document (change back to draft) and then resubmit with same name - just to avoid naming collisions (without the -1,2)? Since we may want to maintain a complete audit history of what was indeed submitted (even though in error) - can this be resolved by a naming series update where a cancelled document gets a different prefix - so that when resubmitted, the new document can inherit the old name? Just wondering if there are other easier ways without completely refactoring frappe / doc submit - which likely impacts every app/doctype …

I don’t know much about either of those programs, but I have to assume they do the same thing that Frappe does on the backend, rebuilding downstream documents on every change.

But, I think you’re onto the core issue, same as @zerodiscount. When these discussions come up, the real problem for people is often not cancellation itself but rather series naming and numbering. There’s definitely plenty of room for new ideas there.

Something similar to the OP was proposed a while back by none less than Rushabh himself.

I think it ended up being pretty messy on implementation and never landed.

I still think most of the issues people have could be fixed with two much lighter changes:

  • More dynamic series handling (e.g., on cancel and amendment, maybe the amended document becomes SN-0001 and the canceled document becomes SN-0001-1.)
  • A UI update that allows cancel and amend in one step, preserving link to other docs in the process

The naming series improvements would open the door to other things long on the wish list too, like documents that get a serial number only on submit, not draft.

Would it be safe to rename the original via the “rename doc” function as the cancelled document, while maintaining the amended document’s original name (while keeping the same “unsubmit” workflow)?

On a side note there is an “allow on submit” property for a field which you can change after submission.
I guess its for the less fragile ones which will not have a domino effect

It depends on the doctype, I think. In general, renaming should be safe if all references are stored in link fields, but doctypes aren’t forced to obey that expectation.

I know GL Entry docs, for example, store doctype names as a comma-separated string in the against field, but I don’t know what if anything reads that. It might just be diagnostic. Anything that syncs against an external api could potentially be a problem too, of course.