[IMP] account_bank_statement_import_paypal: DE mapping; use account number

This commit is contained in:
Alexey Pelykh
2020-04-11 08:14:07 +02:00
committed by manu
parent 3b4db7df53
commit 83f8dcf09e
6 changed files with 85 additions and 8 deletions

View File

@@ -42,7 +42,7 @@ class TestAccountBankStatementImportPayPal(common.TransactionCase):
with open(path.join(path.dirname(__file__), filename)) as file:
return b64encode(file.read().encode('utf-8'))
def test_import_statement_en(self):
def test_import_statement_en_usd(self):
journal = self.AccountJournal.create({
'name': 'PayPal',
'type': 'bank',
@@ -66,6 +66,30 @@ class TestAccountBankStatementImportPayPal(common.TransactionCase):
self.assertEqual(len(statement), 1)
self.assertEqual(len(statement.line_ids), 18)
def test_import_statement_en_eur(self):
journal = self.AccountJournal.create({
'name': 'PayPal',
'type': 'bank',
'code': 'PP',
'currency_id': self.currency_eur.id,
})
wizard = self.AccountBankStatementImport.with_context({
'journal_id': journal.id,
}).create({
'filename': 'fixtures/statement_en.csv',
'data_file': self._data_file('fixtures/statement_en.csv'),
'paypal_mapping_id': self.paypal_statement_map_en.id,
})
wizard.with_context({
'journal_id': journal.id,
'account_bank_statement_import_paypal_test': True,
}).import_file()
statement = self.AccountBankStatement.search([
('journal_id', '=', journal.id),
])
self.assertEqual(len(statement), 1)
self.assertEqual(len(statement.line_ids), 8)
def test_import_statement_es(self):
journal = self.AccountJournal.create({
'name': 'PayPal',