I am facing an issue with a custom DocType in Frappe/ERPNext.
Environment
Custom DocType: DocOps
Is Submittable: Enabled
Issue
I have created a custom DocType named DocOps and marked it as Submittable. After submitting a document, I want to cancel or delete it.
However:
There is no “Cancel” button available in the form.
When I try to delete the document, I get an error stating that the document must be cancelled before it can be deleted.
I am logged in as Administrator.
There are no active workflows on this DocType.
I have already verified that workflow restrictions are not causing the issue.
So I am stuck in a situation where:
The document cannot be cancelled because there is no Cancel option.
The document cannot be deleted because it is submitted.
What I Have Already Checked
DocType is marked as Is Submittable
Logged in as Administrator
No active Workflow exists for this DocType
Tried after disabling all workflows
Refreshed/reloaded the form
Expected Behavior
Submitted documents should display a Cancel action (for users with sufficient permissions such as Administrator), allowing the document to be cancelled and then deleted if required.
Question
Has anyone encountered this issue with a custom submittable DocType?
Is there any additional DocType setting required to enable the Cancel action?
Could this be a bug in Frappe v16?
Are there any permission or controller methods that could prevent the Cancel button from appearing even when the DocType is submittable?
The Cancel button for a submittable DocType is not controlled only by the Is Submittable flag. In Frappe, the Cancel action appears only when the document is in Submitted state (docstatus = 1) and the current user has the required permissions.
A few things to check:
Check Cancel permission
Go to:
Role Permissions Manager → DocOps → Cancel
Make sure the Administrator role (or the user role) has Cancel permission enabled.
Verify the document status
Check the document value:
docstatus = 1
If the document is not actually submitted, the Cancel button will not appear.
Check the DocType controller
If you have a custom Python controller for DocOps, make sure you have not overridden any methods that affect cancellation, for example:
def on_cancel(self):
pass
or custom validation that prevents cancellation.
Check client scripts
A Client Script or custom JS can hide actions from the form. Search for code like:
frm.remove_custom_button("Cancel");
Try clearing cache
After changing permissions or DocType settings:
bench clear-cache
bench restart
Regarding Frappe v16: this is not generally a known bug. The standard behavior is still that submitted documents show Cancel if the user has Cancel permission. In most cases with custom DocTypes, the missing Cancel button is caused by missing permissions, custom scripts, or controller customizations.