mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
fix: do not allow to cancel incomplete reposting (#40224)
This commit is contained in:
@@ -214,14 +214,9 @@ class RepostItemValuation(Document):
|
|||||||
if self.status not in ("Queued", "In Progress"):
|
if self.status not in ("Queued", "In Progress"):
|
||||||
return
|
return
|
||||||
|
|
||||||
if not (self.voucher_no and self.voucher_no):
|
msg = _("Cannot cancel as processing of cancelled documents is pending.")
|
||||||
return
|
msg += "<br>" + _("Please try again in an hour.")
|
||||||
|
frappe.throw(msg, title=_("Pending processing"))
|
||||||
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"))
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def restart_reposting(self):
|
def restart_reposting(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user