From 809e805bc13bbb46cc688d338a392fa66d1bdd92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 3 Jan 2026 14:05:07 +0100 Subject: [PATCH] Defer importing the braintree module only if the webhook is called --- modules/account_payment_braintree/routes.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/account_payment_braintree/routes.py b/modules/account_payment_braintree/routes.py index d3ad963681..6d15c7f105 100644 --- a/modules/account_payment_braintree/routes.py +++ b/modules/account_payment_braintree/routes.py @@ -3,8 +3,6 @@ import http.client import logging -import braintree - from trytond.protocols.wrappers import ( HTTPStatus, Response, abort, with_pool, with_transaction) from trytond.wsgi import app @@ -60,6 +58,7 @@ def checkout(request, pool, model, id): @with_pool @with_transaction(context={'_skip_warnings': True}) def webhooks_endpoint(request, pool, account): + import braintree Account = pool.get('account.payment.braintree.account') account, = Account.search([ ('webhook_identifier', '=', account),