fix: hide Submit button on non-submittable doctypes (#36825)
can_submit() only checked docstatus, permissions, and workflow but never verified the doctype is actually submittable. Since all documents start at docstatus 0, this caused a Submit button to appear on any non-submittable doctype where the user has submit permission (e.g. System Manager).
This commit is contained in:
parent
25df73931b
commit
b408bc92c5
1 changed files with 1 additions and 0 deletions
|
|
@ -670,6 +670,7 @@ frappe.ui.form.Toolbar = class Toolbar {
|
|||
}
|
||||
can_submit() {
|
||||
return (
|
||||
frappe.model.is_submittable(this.frm.doc.doctype) &&
|
||||
this.get_docstatus() === 0 &&
|
||||
!this.frm.doc.__islocal &&
|
||||
!this.frm.doc.__unsaved &&
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue