From ef7246c6113a34bf5c394649750bdda56a1fd7f5 Mon Sep 17 00:00:00 2001 From: Emanuel Cino Date: Fri, 20 Apr 2018 11:05:47 +0200 Subject: [PATCH] Allow inheritance for CAMT parser to add transaction nodes --- account_bank_statement_import_camt/__manifest__.py | 2 +- account_bank_statement_import_camt/models/parser.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/account_bank_statement_import_camt/__manifest__.py b/account_bank_statement_import_camt/__manifest__.py index 1a4d512..e888a2a 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.1', + 'version': '10.0.1.1.2', '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 c98e715..d73159b 100644 --- a/account_bank_statement_import_camt/models/parser.py +++ b/account_bank_statement_import_camt/models/parser.py @@ -99,9 +99,10 @@ class CamtParser(models.AbstractModel): 'account_number' ) - def parse_entry(self, ns, node): + def parse_entry(self, ns, node, transaction=None): """Parse an Ntry node and yield transactions""" - transaction = {'name': '/', 'amount': 0} # fallback defaults + if transaction is None: + transaction = {'name': '/', 'amount': 0} # fallback defaults self.add_value_from_node( ns, node, './ns:BookgDt/ns:Dt', transaction, 'date') amount = self.parse_amount(ns, node)