From 83bb71bb166ef4b341523e368ff881498918bd7e Mon Sep 17 00:00:00 2001 From: alt-odoo Date: Mon, 7 Nov 2022 09:10:32 +0000 Subject: [PATCH] [FIX] website_payment: correct compute of providers state In case stripe provider was deleted, the value of 'stripe' is None. This will trigger a TypeError using the 'in' operation. We should adapt the conditional statement to properly do the computation. closes odoo/odoo#105159 X-original-commit: 12ac629f2989fcf350e9fc69e8ba8e8494f378d9 Signed-off-by: Antoine Vandevenne (anv) --- addons/website_payment/models/res_config_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_payment/models/res_config_settings.py b/addons/website_payment/models/res_config_settings.py index dd0395e7d1f..70c1b5b2f55 100644 --- a/addons/website_payment/models/res_config_settings.py +++ b/addons/website_payment/models/res_config_settings.py @@ -38,7 +38,7 @@ class ResConfigSettings(models.TransientModel): stripe = self.env.ref('payment.payment_provider_stripe', raise_if_not_found=False) for config in self: providers = config._get_activated_providers() - first_provider = stripe if stripe in providers else providers[0] if providers else providers + first_provider = stripe if stripe and stripe in providers else providers[0] if providers else providers config.first_provider_label = _('Configure %s', first_provider.name) if len(providers) == 1 and providers == paypal: config.providers_state = 'paypal_only'