From 2c8c076f6ea0f3379623ed4aa69a348f29d50f3c Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 21 Jul 2026 23:12:53 +0000 Subject: [PATCH] fix(payments): ensure `payments` app installed on the site in `payment_app_import_guard` (backport #57342) (#57344) Co-authored-by: Diptanil Saha --- erpnext/utilities/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/erpnext/utilities/__init__.py b/erpnext/utilities/__init__.py index f01aa1312f6..162e07e2558 100644 --- a/erpnext/utilities/__init__.py +++ b/erpnext/utilities/__init__.py @@ -47,7 +47,11 @@ def payment_app_import_guard(): msg = _("payments app is not installed. Please install it from {} or {}").format( marketplace_link, github_link ) + + if "payments" not in frappe.get_installed_apps(): + frappe.throw(msg, title=_("Missing Payments App"), exc=frappe.AppNotInstalledError) + try: yield except ImportError: - frappe.throw(msg, title=_("Missing Payments App")) + frappe.throw(msg, title=_("Missing Payments App"), exc=frappe.AppNotInstalledError)