[fix] Don't render Workflow Actions when the doc is dirty
This commit is contained in:
parent
3fa666467b
commit
a012a6826d
1 changed files with 5 additions and 1 deletions
|
|
@ -67,6 +67,11 @@ frappe.ui.form.States = Class.extend({
|
|||
|
||||
this.frm.page.clear_actions_menu();
|
||||
|
||||
// if the loaded doc is dirty, don't show workflow buttons
|
||||
if (this.frm.doc.__unsaved===1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.each(frappe.workflow.get_transitions(this.frm.doctype, state), function(i, d) {
|
||||
if(in_list(user_roles, d.allowed)) {
|
||||
added = true;
|
||||
|
|
@ -89,7 +94,6 @@ frappe.ui.form.States = Class.extend({
|
|||
|
||||
// revert state on error
|
||||
var on_error = function() {
|
||||
console.log("here", doc_before_action);
|
||||
// reset in locals
|
||||
frappe.model.add_to_locals(doc_before_action);
|
||||
me.frm.refresh();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue