From 63209f4eac3a317b8358cf394d7997148e0532da Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 13:14:21 +0530 Subject: [PATCH] fix: do not allow to cancel incomplete reposting (backport #40224) (#40230) * fix: do not allow to cancel incomplete reposting (#40224) (cherry picked from commit 72ac56b6c4366910f7fc4f561811240ad0694965) # Conflicts: # erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py * chore: fix conflicts --------- Co-authored-by: rohitwaghchaure --- .../repost_item_valuation/repost_item_valuation.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py index 13937d928b8e..8a73cb6b37bb 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -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 += "
" + _("Please try again in an hour.") - frappe.throw(msg, title=_("Pending processing")) + msg = _("Cannot cancel as processing of cancelled documents is pending.") + msg += "
" + _("Please try again in an hour.") + frappe.throw(msg, title=_("Pending processing")) @frappe.whitelist() def restart_reposting(self):