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

This commit is contained in:
rohitwaghchaure 2024-03-02 12:59:59 +05:30 committed by GitHub
parent e017421708
commit 72ac56b6c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -214,14 +214,9 @@ class RepostItemValuation(Document):
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):