diff --git a/account_bank_statement_import_camt_oca/__manifest__.py b/account_bank_statement_import_camt_oca/__manifest__.py index 10ec288d..a6e72748 100644 --- a/account_bank_statement_import_camt_oca/__manifest__.py +++ b/account_bank_statement_import_camt_oca/__manifest__.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "CAMT Format Bank Statements Import", - "version": "13.0.1.0.0", + "version": "13.0.1.0.1", "license": "AGPL-3", "author": "Therp BV, Odoo Community Association (OCA)", "website": "https://github.com/OCA/bank-statement-import", diff --git a/account_bank_statement_import_camt_oca/models/parser.py b/account_bank_statement_import_camt_oca/models/parser.py index 971b4206..a149b917 100644 --- a/account_bank_statement_import_camt_oca/models/parser.py +++ b/account_bank_statement_import_camt_oca/models/parser.py @@ -242,8 +242,11 @@ class CamtParser(models.AbstractModel): try: root = etree.fromstring(data, parser=etree.XMLParser(recover=True)) except etree.XMLSyntaxError: - # ABNAmro is known to mix up encodings - root = etree.fromstring(data.decode("iso-8859-15").encode("utf-8")) + try: + # ABNAmro is known to mix up encodings + root = etree.fromstring(data.decode("iso-8859-15").encode("utf-8")) + except etree.XMLSyntaxError: + root = None if root is None: raise ValueError("Not a valid xml file, or not an xml file at all.") ns = root.tag[1 : root.tag.index("}")]