mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[FIX] Fix same eror in camt54 module
This commit is contained in:
@@ -219,8 +219,6 @@ class CamtParser(models.AbstractModel):
|
|||||||
result["date"] = sorted(
|
result["date"] = sorted(
|
||||||
transactions, key=lambda x: x["date"], reverse=True
|
transactions, key=lambda x: x["date"], reverse=True
|
||||||
)[0]["date"]
|
)[0]["date"]
|
||||||
for seq, vals in enumerate(transactions, start=1):
|
|
||||||
vals["sequence"] = seq
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def check_version(self, ns, root):
|
def check_version(self, ns, root):
|
||||||
|
|||||||
@@ -10,13 +10,11 @@
|
|||||||
'narration': 'CRÉDIT GROUPÉ BVR TRAITEMENT DU 22.03.2017 NUMÉRO CLIENT 01-70884-3 PAQUET ID: 123456CHCAFEBABE',
|
'narration': 'CRÉDIT GROUPÉ BVR TRAITEMENT DU 22.03.2017 NUMÉRO CLIENT 01-70884-3 PAQUET ID: 123456CHCAFEBABE',
|
||||||
'partner_name': 'Banque Cantonale Vaudoise',
|
'partner_name': 'Banque Cantonale Vaudoise',
|
||||||
'payment_ref': '/',
|
'payment_ref': '/',
|
||||||
'ref': '302388292000011111111111111',
|
'ref': '302388292000011111111111111'},
|
||||||
'sequence': 1},
|
|
||||||
{'account_number': 'CH3333000000123456789',
|
{'account_number': 'CH3333000000123456789',
|
||||||
'amount': 1296.0,
|
'amount': 1296.0,
|
||||||
'date': '2017-03-22',
|
'date': '2017-03-22',
|
||||||
'narration': 'CRÉDIT GROUPÉ BVR TRAITEMENT DU 22.03.2017 NUMÉRO CLIENT 01-70884-3 PAQUET ID: 123456CHCAFEBABE',
|
'narration': 'CRÉDIT GROUPÉ BVR TRAITEMENT DU 22.03.2017 NUMÉRO CLIENT 01-70884-3 PAQUET ID: 123456CHCAFEBABE',
|
||||||
'partner_name': 'Banque Cantonale Vaudoise',
|
'partner_name': 'Banque Cantonale Vaudoise',
|
||||||
'payment_ref': '/',
|
'payment_ref': '/',
|
||||||
'ref': '302388292000022222222222222',
|
'ref': '302388292000022222222222222'}]}])
|
||||||
'sequence': 2}]}])
|
|
||||||
|
|||||||
@@ -9,26 +9,22 @@
|
|||||||
'date': '2014-01-05',
|
'date': '2014-01-05',
|
||||||
'partner_name': 'INSURANCE COMPANY TESTX',
|
'partner_name': 'INSURANCE COMPANY TESTX',
|
||||||
'payment_ref': 'MKB Insurance 859239PERIOD 01.01.2014 - 31.12.2014',
|
'payment_ref': 'MKB Insurance 859239PERIOD 01.01.2014 - 31.12.2014',
|
||||||
'ref': '435005714488-ABNO33052620',
|
'ref': '435005714488-ABNO33052620'},
|
||||||
'sequence': 1},
|
|
||||||
{'account_number': 'NL46ABNA0499998748',
|
{'account_number': 'NL46ABNA0499998748',
|
||||||
'amount': -564.05,
|
'amount': -564.05,
|
||||||
'date': '2014-01-05',
|
'date': '2014-01-05',
|
||||||
'partner_name': 'Test Customer',
|
'partner_name': 'Test Customer',
|
||||||
'payment_ref': 'Direct debit S14 0410 AC07 Rek.nummer blokkade TESTBANK/NL/20141229/01206408',
|
'payment_ref': 'Direct debit S14 0410 AC07 Rek.nummer blokkade TESTBANK/NL/20141229/01206408',
|
||||||
'ref': 'TESTBANK/NL/20141229/01206408',
|
'ref': 'TESTBANK/NL/20141229/01206408'},
|
||||||
'sequence': 2},
|
|
||||||
{'account_number': 'NL46ABNA0499998748',
|
{'account_number': 'NL46ABNA0499998748',
|
||||||
'amount': -100.0,
|
'amount': -100.0,
|
||||||
'date': '2014-01-05',
|
'date': '2014-01-05',
|
||||||
'partner_name': 'Test Customer',
|
'partner_name': 'Test Customer',
|
||||||
'payment_ref': 'Direct debit S14 0410 AC07 Rek.nummer blokkade TESTBANK/NL/20141229/01206408',
|
'payment_ref': 'Direct debit S14 0410 AC07 Rek.nummer blokkade TESTBANK/NL/20141229/01206408',
|
||||||
'ref': 'TESTBANK/NL/20141229/01206407',
|
'ref': 'TESTBANK/NL/20141229/01206407'},
|
||||||
'sequence': 3},
|
|
||||||
{'account_number': 'NL69ABNA0522123643',
|
{'account_number': 'NL69ABNA0522123643',
|
||||||
'amount': 1405.31,
|
'amount': 1405.31,
|
||||||
'date': '2014-01-05',
|
'date': '2014-01-05',
|
||||||
'partner_name': '3rd party Media',
|
'partner_name': '3rd party Media',
|
||||||
'payment_ref': '#RD PARTY MEDIA CUSNO 90782 4210773',
|
'payment_ref': '#RD PARTY MEDIA CUSNO 90782 4210773',
|
||||||
'ref': '115',
|
'ref': '115'}]}])
|
||||||
'sequence': 4}]}])
|
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ class TestImport(TransactionCase):
|
|||||||
)
|
)
|
||||||
with open(testfile, "rb") as datafile:
|
with open(testfile, "rb") as datafile:
|
||||||
camt_file = base64.b64encode(datafile.read())
|
camt_file = base64.b64encode(datafile.read())
|
||||||
|
|
||||||
self.env["account.statement.import"].create(
|
self.env["account.statement.import"].create(
|
||||||
{
|
{
|
||||||
"statement_filename": "test import",
|
"statement_filename": "test import",
|
||||||
@@ -156,4 +157,5 @@ class TestImport(TransactionCase):
|
|||||||
[("name", "in", ["1234Test/2", "1234Test/3"])]
|
[("name", "in", ["1234Test/2", "1234Test/3"])]
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertTrue(all([st.line_ids for st in bank_st_record]))
|
self.assertTrue(all([st.line_ids for st in bank_st_record]))
|
||||||
|
self.assertEqual(bank_st_record[0].line_ids.mapped("sequence"), [1, 2, 3])
|
||||||
|
|||||||
Reference in New Issue
Block a user