Skip to content

Commit

Permalink
fix: cannot restore cancelled document if workflow is active
Browse files Browse the repository at this point in the history
(cherry picked from commit d2f5294)
  • Loading branch information
shariquerik authored and mergify[bot] committed Apr 3, 2023
1 parent 08398cb commit 6206dc0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frappe/core/doctype/deleted_document/deleted_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ def restore(name, alert=True):
except frappe.DocstatusTransitionError:
frappe.msgprint(_("Cancelled Document restored as Draft"))
doc.docstatus = 0
if doc.workflow_state:
doc.workflow_state = None
doc.insert()

doc.add_comment("Edit", _("restored {0} as {1}").format(deleted.deleted_name, doc.name))
Expand Down

0 comments on commit 6206dc0

Please sign in to comment.