From a8fb175913585402779e727d56fd06d02bfc8407 Mon Sep 17 00:00:00 2001 From: david wulliamoz Date: Tue, 18 Apr 2017 17:24:46 +0200 Subject: [PATCH 1/3] allow camt054 to be parsed IMP README --- account_bank_statement_import_camt/README.rst | 2 +- account_bank_statement_import_camt/__manifest__.py | 2 +- account_bank_statement_import_camt/models/parser.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/account_bank_statement_import_camt/README.rst b/account_bank_statement_import_camt/README.rst index a564f7a..92aaeaa 100644 --- a/account_bank_statement_import_camt/README.rst +++ b/account_bank_statement_import_camt/README.rst @@ -4,7 +4,7 @@ Bank Statement Parse Camt ========================= -Module to import SEPA CAMT.053 Format bank statement files. +Module to import SEPA CAMT.053 and CAMT.054 Format bank statement files. Based on the Banking addons framework. diff --git a/account_bank_statement_import_camt/__manifest__.py b/account_bank_statement_import_camt/__manifest__.py index 1ff167c..1a4d512 100644 --- a/account_bank_statement_import_camt/__manifest__.py +++ b/account_bank_statement_import_camt/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'CAMT Format Bank Statements Import', - 'version': '10.0.1.1.0', + 'version': '10.0.1.1.1', 'license': 'AGPL-3', 'author': 'Odoo Community Association (OCA), Therp BV', 'website': 'https://github.com/OCA/bank-statement-import', diff --git a/account_bank_statement_import_camt/models/parser.py b/account_bank_statement_import_camt/models/parser.py index 51d7820..cc4b6be 100644 --- a/account_bank_statement_import_camt/models/parser.py +++ b/account_bank_statement_import_camt/models/parser.py @@ -210,10 +210,12 @@ class CamtParser(models.AbstractModel): ) if not re_camt.search(ns): raise ValueError('no camt: ' + ns) - # Check wether version 052 or 053: + # Check wether version 052 ,053 or 054: re_camt_version = re.compile( + r'(^urn:iso:std:iso:20022:tech:xsd:camt.054.' r'(^urn:iso:std:iso:20022:tech:xsd:camt.053.' r'|^urn:iso:std:iso:20022:tech:xsd:camt.052.' + r'|^ISO:camt.054.' r'|^ISO:camt.053.' r'|^ISO:camt.052.)' ) From e6f26df58a10863ebb1e3bccbb8e6fb192926fa7 Mon Sep 17 00:00:00 2001 From: Emanuel Cino Date: Wed, 19 Apr 2017 08:36:53 +0200 Subject: [PATCH 2/3] Fix typo --- account_bank_statement_import_camt/models/parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_bank_statement_import_camt/models/parser.py b/account_bank_statement_import_camt/models/parser.py index cc4b6be..2165774 100644 --- a/account_bank_statement_import_camt/models/parser.py +++ b/account_bank_statement_import_camt/models/parser.py @@ -213,7 +213,7 @@ class CamtParser(models.AbstractModel): # Check wether version 052 ,053 or 054: re_camt_version = re.compile( r'(^urn:iso:std:iso:20022:tech:xsd:camt.054.' - r'(^urn:iso:std:iso:20022:tech:xsd:camt.053.' + r'|^urn:iso:std:iso:20022:tech:xsd:camt.053.' r'|^urn:iso:std:iso:20022:tech:xsd:camt.052.' r'|^ISO:camt.054.' r'|^ISO:camt.053.' From b660f5b4bf880df6af63b56ff8cbdba0f3babb40 Mon Sep 17 00:00:00 2001 From: eLBati Date: Tue, 20 Feb 2018 12:41:56 +0100 Subject: [PATCH 3/3] FIX account_bank_statement_import_camt error message and comment --- account_bank_statement_import_camt/models/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_bank_statement_import_camt/models/parser.py b/account_bank_statement_import_camt/models/parser.py index 2165774..abf2d36 100644 --- a/account_bank_statement_import_camt/models/parser.py +++ b/account_bank_statement_import_camt/models/parser.py @@ -220,14 +220,14 @@ class CamtParser(models.AbstractModel): r'|^ISO:camt.052.)' ) if not re_camt_version.search(ns): - raise ValueError('no camt 052 or 053: ' + ns) + raise ValueError('no camt 052 or 053 or 054: ' + ns) # Check GrpHdr element: root_0_0 = root[0][0].tag[len(ns) + 2:] # strip namespace if root_0_0 != 'GrpHdr': raise ValueError('expected GrpHdr, got: ' + root_0_0) def parse(self, data): - """Parse a camt.052 or camt.053 file.""" + """Parse a camt.052 or camt.053 or camt.054 file.""" try: root = etree.fromstring( data, parser=etree.XMLParser(recover=True))