Skip to content

Commit

Permalink
fix: do not allow to cancel incomplete reposting (#40224)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitwaghchaure authored Mar 2, 2024
1 parent e017421 commit 72ac56b
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,9 @@ def check_pending_repost_against_cancelled_transaction(self):
if self.status not in ("Queued", "In Progress"):
return

if not (self.voucher_no and self.voucher_no):
return

transaction_status = frappe.db.get_value(self.voucher_type, self.voucher_no, "docstatus")
if transaction_status == 2:
msg = _("Cannot cancel as processing of cancelled documents is pending.")
msg += "<br>" + _("Please try again in an hour.")
frappe.throw(msg, title=_("Pending processing"))
msg = _("Cannot cancel as processing of cancelled documents is pending.")
msg += "<br>" + _("Please try again in an hour.")
frappe.throw(msg, title=_("Pending processing"))

@frappe.whitelist()
def restart_reposting(self):
Expand Down

0 comments on commit 72ac56b

Please sign in to comment.