From 8a47ed9c6e55fe0fac5cbca2d57619fa4e43490c Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 30 Nov 2020 16:01:56 +0000 Subject: [FIX] payment_stripe: icon without name The `name` field is not required on the `payment.icon` model. Therefore, in case the payment icon name is not set, a traceback is raised due to a `False.lower()` statement. opw-2409755 closes odoo/odoo#62644 X-original-commit: 54434a4fdd71b1e344255fb6f3e42d731ba91f3b Signed-off-by: Nicolas Martinelli (nim) --- addons/payment_stripe/models/payment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/payment_stripe/models/payment.py b/addons/payment_stripe/models/payment.py index 79123a769ff..41dd09ba8a4 100644 --- a/addons/payment_stripe/models/payment.py +++ b/addons/payment_stripe/models/payment.py @@ -88,8 +88,8 @@ class PaymentAcquirerStripe(models.Model): PMT('p24', ['pl'], ['eur', 'pln'], 'punctual'), ] - existing_icons = [icon.name.lower() for icon in self.env['payment.icon'].search([])] - linked_icons = [icon.name.lower() for icon in self.payment_icon_ids] + existing_icons = [(icon.name or '').lower() for icon in self.env['payment.icon'].search([])] + linked_icons = [(icon.name or '').lower() for icon in self.payment_icon_ids] # We don't filter out pmt in the case the icon doesn't exist at all as it would be **implicit** exclusion icon_filtered = filter(lambda pmt: pmt.name == 'card' or -- cgit v1.2.3