From b7802351f2d90b1df79a68592b25fb2e6860a60c Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Fri, 1 Mar 2024 23:10:09 +0530 Subject: [PATCH] fix: do not allow to cancel incomplete reposting --- .../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 a383798af57e..67416f11037c 100644 --- a/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py +++ b/erpnext/stock/doctype/repost_item_valuation/repost_item_valuation.py @@ -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 += "
" + _("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):