fix: validate on hold purchase invoices in payment entry

This commit is contained in:
Saqib Ansari 2022-05-11 12:42:35 +05:30
parent b8dc40b7a0
commit b0f302e579

View File

@ -346,6 +346,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:
frappe.throw(_("{0} {1} must be submitted").format(d.reference_doctype, d.reference_name))