mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[MIG] account_bank_statement_import_camt_details: Migration to 10.0
This commit is contained in:
@@ -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': '9.0.1.0.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'license': 'AGPL-3',
|
||||
'author': 'Odoo Community Association (OCA), Compassion CH',
|
||||
'website': 'https://github.com/OCA/bank-statement-import',
|
||||
@@ -2,7 +2,7 @@
|
||||
"""Add process_camt method to account.bank.statement.import."""
|
||||
# © 2017 Compassion CH <http://www.compassion.ch>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
from openerp import models, fields
|
||||
from odoo import models, fields
|
||||
|
||||
|
||||
class AccountBankStatementLine(models.Model):
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# © 2017 Compassion CH <http://www.compassion.ch>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
from openerp import models
|
||||
from openerp.tools import OrderedDict
|
||||
from odoo import models
|
||||
from odoo.tools import OrderedDict
|
||||
|
||||
|
||||
class CamtDetailsParser(models.AbstractModel):
|
||||
@@ -44,9 +44,15 @@ class CamtDetailsParser(models.AbstractModel):
|
||||
transaction['partner_address'] = self._format_partner_address(
|
||||
address_values)
|
||||
|
||||
# BIC node
|
||||
bic_node = node.xpath(
|
||||
'./ns:RltdAgts/ns:%sAgt/ns:FinInstnId/ns:BIC' % party_type,
|
||||
namespaces={'ns': ns})
|
||||
if bic_node:
|
||||
transaction['partner_bic'] = bic_node[0].text
|
||||
|
||||
# Transfer account info in fields
|
||||
transaction['partner_account'] = transaction.get('account_number')
|
||||
transaction['partner_bic'] = transaction.get('account_bic')
|
||||
|
||||
def _format_partner_address(self, address_values):
|
||||
"""
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
# © 2017 CompassionCH <http://therp.nl>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
import base64
|
||||
from openerp.tests.common import TransactionCase
|
||||
from openerp.tools.misc import file_open
|
||||
from odoo.tests.common import TransactionCase
|
||||
from odoo.tools.misc import file_open
|
||||
|
||||
|
||||
class TestImport(TransactionCase):
|
||||
@@ -28,10 +28,10 @@ class TestImport(TransactionCase):
|
||||
"""Test that transaction details are correctly imported."""
|
||||
line_details = [
|
||||
{
|
||||
'partner_account': 'NL46ABNA0499998748',
|
||||
'partner_account': 'NL69ABNA0522123643',
|
||||
'partner_bic': 'ABNANL2A',
|
||||
'partner_name': 'INSURANCE COMPANY TESTX',
|
||||
'partner_address': 'TEST STREET 20, 1234 AB TESTCITY'
|
||||
'partner_name': '3rd party Media',
|
||||
'partner_address': 'SOMESTREET 570-A, 1276 ML HOUSCITY'
|
||||
},
|
||||
{
|
||||
'partner_account': 'NL46ABNA0499998748',
|
||||
@@ -39,10 +39,10 @@ class TestImport(TransactionCase):
|
||||
'partner_name': 'Test Customer',
|
||||
},
|
||||
{
|
||||
'partner_account': 'NL69ABNA0522123643',
|
||||
'partner_account': 'NL46ABNA0499998748',
|
||||
'partner_bic': 'ABNANL2A',
|
||||
'partner_name': '3rd party Media',
|
||||
'partner_address': 'SOMESTREET 570-A, 1276 ML HOUSCITY'
|
||||
'partner_name': 'INSURANCE COMPANY TESTX',
|
||||
'partner_address': 'TEST STREET 20, 1234 AB TESTCITY'
|
||||
},
|
||||
]
|
||||
with file_open(
|
||||
|
||||
Reference in New Issue
Block a user