Skip to content

Commit

Permalink
restore cancel doc in draft state
Browse files Browse the repository at this point in the history
  • Loading branch information
Zlash65 committed Oct 25, 2017
1 parent ebf3554 commit 7a8a3ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frappe/core/doctype/deleted_document/deleted_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def restore(name):
try:
doc.insert()
except frappe.DocstatusTransitionError:
frappe.throw(_("Cannot restore Cancelled Document"))
frappe.msgprint(_("Cancelled Document restored as Draft"))
doc.docstatus = 0
doc.insert()

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

Expand Down

0 comments on commit 7a8a3ad

Please sign in to comment.