From 530308ef4488381e5146614b861ab4a44ed39fd0 Mon Sep 17 00:00:00 2001 From: Ronald Portier Date: Tue, 12 Apr 2022 14:42:53 +0200 Subject: [PATCH] [FIX] *_ponto: solve exception on empty name The name for a transaction imported from Ponto is taken from the remittanceInformation, failing that, the reference should be used. However in case the transaction attributes do contain the remittanceInformation key, but the value is False or empty, the failover to the reference fails. --- .../models/online_bank_statement_provider_ponto.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_bank_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py b/account_bank_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py index 096b96a..6802313 100644 --- a/account_bank_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py +++ b/account_bank_statement_import_online_ponto/models/online_bank_statement_provider_ponto.py @@ -212,7 +212,7 @@ class OnlineBankStatementProviderPonto(models.Model): 'sequence': sequence, 'date': date, 'ref': re.sub(' +', ' ', ref) or '/', - 'name': attributes.get('remittanceInformation', ref), + 'name': attributes.get('remittanceInformation') or ref, 'unique_import_id': transaction['id'], 'amount': attributes['amount'], }