diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-11-30 16:01:56 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-11-30 17:52:16 +0000 |
| commit | 8a47ed9c6e55fe0fac5cbca2d57619fa4e43490c (patch) | |
| tree | a58f1106c10b462fce20eade3d17a5c5685f071a | |
| parent | b0934721267632b2be6c2327fd7583fe1ea8d837 (diff) | |
[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) <nim@odoo.com>
| -rw-r--r-- | addons/payment_stripe/models/payment.py | 4 |
1 files 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 |
