fix: validate on hold purchase invoices in payment entry

(cherry picked from commit b0f302e579)
This commit is contained in:
Saqib Ansari
2022-05-11 12:42:35 +05:30
committed by Mergify
parent 43ebe946f1
commit 9fbd170fa4

View File

@@ -357,6 +357,12 @@ class PaymentEntry(AccountsController):
) )
) )
if ref_doc.doctype == "Purchase Invoice" and ref_doc.get("on_hold"):
frappe.throw(
_("{0} {1} is on hold").format(d.reference_doctype, d.reference_name),
title=_("Invalid Invoice"),
)
if ref_doc.docstatus != 1: if ref_doc.docstatus != 1:
frappe.throw(_("{0} {1} must be submitted").format(d.reference_doctype, d.reference_name)) frappe.throw(_("{0} {1} must be submitted").format(d.reference_doctype, d.reference_name))