From 12d77d271c61461611527a8faa1c4dac279da15a Mon Sep 17 00:00:00 2001 From: "Anh Thao Pham (pta)" Date: Mon, 25 May 2020 09:51:13 +0000 Subject: [PATCH] [FIX] payment_stripe: fix "lower()" applied to bool with stripe payment - Go to Website > Configuration > eCommerce > Payment Acquirers - Activate Stripe - Configure Stripe - Go to Sales - Create a quotation - Send quotation by email - Click on "Customer Preview" smart button - On Website, click on "Sign & Pay" or "Pay Now" if already signed - Sign it and confirm on "Accept & Sign" - On payment wizard, select "Credit Card (powered by Stripe)" - Validate with "Pay & Confirm" button An error message appears. opw-2262990 closes odoo/odoo#51815 X-original-commit: 3c5117eaac96604a3306c90480d106e0e36fed2f Signed-off-by: Nicolas Martinelli (nim) --- addons/payment_stripe/models/payment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/payment_stripe/models/payment.py b/addons/payment_stripe/models/payment.py index 65e3047df5c..7ea1df1a37b 100644 --- a/addons/payment_stripe/models/payment.py +++ b/addons/payment_stripe/models/payment.py @@ -51,7 +51,8 @@ class PaymentAcquirerStripe(models.Model): 'payment_intent_data[description]': tx_values['reference'], 'customer_email': tx_values.get('partner_email') or tx_values.get('billing_partner_email'), } - if tx_values.get('billing_partner_country').code.lower() == 'nl' and tx_values.get('currency').name.lower() == 'eur': + if tx_values.get('billing_partner_country').code and tx_values.get('billing_partner_country').code.lower() == 'nl' and \ + tx_values.get('currency').name and tx_values.get('currency').name.lower() == 'eur': # enable iDEAL for NL-based customers (€ payments only) stripe_session_data['payment_method_types[1]'] = 'ideal' tx_values['session_id'] = self._create_stripe_session(stripe_session_data)