From 8cb96496ec75d900e21a65bf6f71f43d8d6ec3d7 Mon Sep 17 00:00:00 2001 From: Diptanil Saha Date: Wed, 22 Jul 2026 02:51:40 +0530 Subject: [PATCH] fix(payments): ensure `payments` app installed on the site in `payment_app_import_guard` (#57342) --- 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 fa1054c9dd4..f33258110e4 100644 --- a/erpnext/utilities/__init__.py +++ b/erpnext/utilities/__init__.py @@ -78,7 +78,11 @@ def payment_app_import_guard(): msg = _("payments app is not installed. Please install it from {0} or {1}").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)