Skip to content

Commit

Permalink
fix: do not allow to cancel incomplete reposting (backport #40224) (#…
Browse files Browse the repository at this point in the history
…40230)

* fix: do not allow to cancel incomplete reposting (#40224)

(cherry picked from commit 72ac56b)

# Conflicts:
#	erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py

* chore: fix conflicts

---------

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
  • Loading branch information
mergify[bot] and rohitwaghchaure authored Mar 4, 2024
1 parent 93f3af7 commit 63209f4
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,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 63209f4

Please sign in to comment.