mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
Allow inheritance for CAMT parser to add transaction nodes
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
{
|
{
|
||||||
'name': 'CAMT Format Bank Statements Import',
|
'name': 'CAMT Format Bank Statements Import',
|
||||||
'version': '10.0.1.1.1',
|
'version': '10.0.1.1.2',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'author': 'Odoo Community Association (OCA), Therp BV',
|
'author': 'Odoo Community Association (OCA), Therp BV',
|
||||||
'website': 'https://github.com/OCA/bank-statement-import',
|
'website': 'https://github.com/OCA/bank-statement-import',
|
||||||
|
|||||||
@@ -99,9 +99,10 @@ class CamtParser(models.AbstractModel):
|
|||||||
'account_number'
|
'account_number'
|
||||||
)
|
)
|
||||||
|
|
||||||
def parse_entry(self, ns, node):
|
def parse_entry(self, ns, node, transaction=None):
|
||||||
"""Parse an Ntry node and yield transactions"""
|
"""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(
|
self.add_value_from_node(
|
||||||
ns, node, './ns:BookgDt/ns:Dt', transaction, 'date')
|
ns, node, './ns:BookgDt/ns:Dt', transaction, 'date')
|
||||||
amount = self.parse_amount(ns, node)
|
amount = self.parse_amount(ns, node)
|
||||||
|
|||||||
Reference in New Issue
Block a user