From c91d83dbc8811be7534e0c0d19c321fd10d50f43 Mon Sep 17 00:00:00 2001 From: Emanuel Cino Date: Thu, 7 Feb 2019 17:02:56 +0100 Subject: [PATCH 1/3] Add more address lines information when parsing camt --- .../test_files/test-camt053 | 4 ++-- .../models/camt_parser.py | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/account_bank_statement_import_camt/test_files/test-camt053 b/account_bank_statement_import_camt/test_files/test-camt053 index 1f15c84c..f0fb4a63 100644 --- a/account_bank_statement_import_camt/test_files/test-camt053 +++ b/account_bank_statement_import_camt/test_files/test-camt053 @@ -262,8 +262,8 @@ 3rd party Media - SOMESTREET 570-A - 1276 ML HOUSCITY + SOMESTREET 570-A + 1276 ML HOUSCITY NL diff --git a/account_bank_statement_import_camt_details/models/camt_parser.py b/account_bank_statement_import_camt_details/models/camt_parser.py index 2ad94cf5..c64a3816 100644 --- a/account_bank_statement_import_camt_details/models/camt_parser.py +++ b/account_bank_statement_import_camt_details/models/camt_parser.py @@ -33,6 +33,13 @@ class CamtDetailsParser(models.AbstractModel): './ns:BldgNb', namespaces={'ns': ns}) if building_node: address_values['building'] = building_node[0].text + generic_nodes = address_node[0].xpath( + './ns:AdrLine', namespaces={'ns': ns}) + if generic_nodes: + address_values.update({ + 'address_line_' + str(i): node.text + for i, node in enumerate(generic_nodes) + }) zip_node = address_node[0].xpath( './ns:PstCd', namespaces={'ns': ns}) if zip_node: @@ -58,7 +65,8 @@ class CamtDetailsParser(models.AbstractModel): """ Hook for formatting the partner address read in CAMT bank statement. :param address_values: dict: all address values found in statement - Possible keys are ['street', 'building', 'zip', 'city'] + Possible keys are ['street', 'building', 'address_line_xxx', + 'zip', 'city'] Not all keys may be present. :return: str: formatted address """ From 1fd2b4db7e4d6d5e0f241830007ba795c0b261df Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 19 Jul 2019 07:32:43 +0000 Subject: [PATCH 2/3] account_bank_statement_import_camt_details 10.0.1.0.1 --- account_bank_statement_import_camt_details/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_bank_statement_import_camt_details/__manifest__.py b/account_bank_statement_import_camt_details/__manifest__.py index 3d0c52f6..0c96b8a9 100644 --- a/account_bank_statement_import_camt_details/__manifest__.py +++ b/account_bank_statement_import_camt_details/__manifest__.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'CAMT Debitor Details Bank Statements Import', - 'version': '10.0.1.0.0', + 'version': '10.0.1.0.1', 'license': 'AGPL-3', 'author': 'Odoo Community Association (OCA), Compassion CH', 'website': 'https://github.com/OCA/bank-statement-import', From fa74437df9411b716a9a77cbcb6d70a015de6500 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 19 Jul 2019 07:32:43 +0000 Subject: [PATCH 3/3] account_bank_statement_import_camt 10.0.1.1.6 --- account_bank_statement_import_camt/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_bank_statement_import_camt/__manifest__.py b/account_bank_statement_import_camt/__manifest__.py index 3bd1a9da..73be155b 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.5', + 'version': '10.0.1.1.6', 'license': 'AGPL-3', 'author': 'Odoo Community Association (OCA), Therp BV', 'website': 'https://github.com/OCA/bank-statement-import',