[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) <nim@odoo.com>
This commit is contained in:
Anh Thao Pham (pta)
2020-05-25 13:24:11 +00:00
parent 97d439ae9c
commit 12d77d271c
+2 -1
View File
@@ -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)