fix: validate on hold purchase invoices in payment entry
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 7257e6d..a3a7be2 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -346,6 +346,12 @@
)
)
+ 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))