diff --git a/account_ebics/__manifest__.py b/account_ebics/__manifest__.py index 6b670b0..8b9f378 100644 --- a/account_ebics/__manifest__.py +++ b/account_ebics/__manifest__.py @@ -7,7 +7,7 @@ "Download bank statements and upload payment files directly from Odoo, " "using the European EBICS standard" ), - "version": "18.0.1.3.0", + "version": "18.0.1.3.1", "license": "LGPL-3", "author": "Noviat", "website": "https://www.noviat.com/", diff --git a/account_ebics/models/ebics_file.py b/account_ebics/models/ebics_file.py index 9c0c35f..f414cb4 100644 --- a/account_ebics/models/ebics_file.py +++ b/account_ebics/models/ebics_file.py @@ -568,10 +568,14 @@ class EbicsFile(models.Model): """ datas = [] file_data = base64.b64decode(self.data) - root = etree.fromstring(file_data, parser=etree.XMLParser(recover=True)) + try: + root = etree.fromstring(file_data, parser=etree.XMLParser(recover=True)) + except etree.XMLSyntaxError: + root = None if root is None: message = self.env._("Invalid XML file.") res["notifications"].append({"type": "error", "message": message}) + return datas ns = {k or "ns": v for k, v in root.nsmap.items()} camt_variant = ns["ns"].split("camt.")[1][:3] variant_tags = {