fix: iff workflow state of doc is already correct, don't set workflow state
This commit is contained in:
parent
70316e8670
commit
44cbdb0ebd
1 changed files with 6 additions and 0 deletions
|
|
@ -221,6 +221,12 @@ def show_progress(docnames, message, i, description):
|
|||
def set_workflow_state_on_action(doc, workflow_name, action):
|
||||
workflow = frappe.get_doc('Workflow', workflow_name)
|
||||
workflow_state_field = workflow.workflow_state_field
|
||||
|
||||
# If workflow state of doc is already correct, don't set workflow state
|
||||
for state in workflow.states:
|
||||
if state.state == doc.get(workflow_state_field) and doc.docstatus == cint(state.doc_status):
|
||||
return
|
||||
|
||||
action_map = {
|
||||
'submit': '1',
|
||||
'cancel': '2'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue