From dc1cddb577e432a3e0a3f00f101aea9c10e998df Mon Sep 17 00:00:00 2001 From: mafo-odoo Date: Thu, 6 Oct 2022 06:20:33 +0000 Subject: [PATCH] [FIX] payment_stripe: allow payment for client without mail Problem: If you have a customer assigned to an invoice/quotation without an e-mail address and then share a payment link with the customer. If the customer clicks on 'Pay', he won't be redirected to Stripe's checkout page. He'll get instead 'Invalid e-mail address: False' (see the image attached). Explanation: When there is no e-mail address defined, Odoo sends 'False' to Stripe but Stripe sees it as the e-mail address which is indeed Invalid. To solve the issue we replace False by None for the email value of a customer without email address. opw-3007866 closes odoo/odoo#102867 X-original-commit: 647a5fd79b88d4ea00eca2d6c1f9d9a2259a8414 Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Fockedey Martin (mafo) --- addons/payment_stripe/models/payment_transaction.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment_stripe/models/payment_transaction.py b/addons/payment_stripe/models/payment_transaction.py index de5c6e23219..ceb2fcbdebd 100644 --- a/addons/payment_stripe/models/payment_transaction.py +++ b/addons/payment_stripe/models/payment_transaction.py @@ -146,7 +146,7 @@ class PaymentTransaction(models.Model): 'address[postal_code]': self.partner_zip or None, 'address[state]': self.partner_state_id.name or None, 'description': f'Odoo Partner: {self.partner_id.name} (id: {self.partner_id.id})', - 'email': self.partner_email, + 'email': self.partner_email or None, 'name': self.partner_name, 'phone': self.partner_phone or None, }