mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
[MIG] account_bank_statement_import_paypal: adapt improvements to v11
This commit is contained in:
@@ -20,11 +20,6 @@
|
|||||||
'multi_step_wizard',
|
'multi_step_wizard',
|
||||||
'web_widget_dropdown_dynamic',
|
'web_widget_dropdown_dynamic',
|
||||||
],
|
],
|
||||||
'external_dependencies': {
|
|
||||||
'python': [
|
|
||||||
'csv',
|
|
||||||
]
|
|
||||||
},
|
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
'data/maps.xml',
|
'data/maps.xml',
|
||||||
|
|||||||
@@ -3,4 +3,3 @@
|
|||||||
from . import account_bank_statement_import_paypal_mapping
|
from . import account_bank_statement_import_paypal_mapping
|
||||||
from . import account_bank_statement_import_paypal_parser
|
from . import account_bank_statement_import_paypal_parser
|
||||||
from . import account_bank_statement_import
|
from . import account_bank_statement_import
|
||||||
from . import account_journal
|
|
||||||
|
|||||||
@@ -32,4 +32,4 @@ class AccountBankStatementImport(models.TransientModel):
|
|||||||
'account_bank_statement_import_paypal_test'):
|
'account_bank_statement_import_paypal_test'):
|
||||||
raise
|
raise
|
||||||
_logger.warning('PayPal parser error', exc_info=True)
|
_logger.warning('PayPal parser error', exc_info=True)
|
||||||
return super()._parse_file(data_file)
|
return super(AccountBankStatementImport, self)._parse_file(data_file)
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
# Copyright 2019 Tecnativa - Vicent Cubells
|
|
||||||
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
|
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
||||||
|
|
||||||
from odoo import models
|
|
||||||
|
|
||||||
|
|
||||||
class AccountJournal(models.Model):
|
|
||||||
_inherit = 'account.journal'
|
|
||||||
|
|
||||||
def _get_bank_statements_available_import_formats(self):
|
|
||||||
res = super()._get_bank_statements_available_import_formats()
|
|
||||||
res.append('PayPal Reports')
|
|
||||||
return res
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# Copyright 2019 Tecnativa - Vicent Cubells
|
# Copyright 2019 Tecnativa - Vicent Cubells
|
||||||
# Copyright 2019 Brainbean Apps (https://brainbeanapps.com)
|
# Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com)
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import fields
|
from odoo import fields
|
||||||
@@ -12,7 +12,7 @@ from os import path
|
|||||||
|
|
||||||
class TestAccountBankStatementImportPayPal(common.TransactionCase):
|
class TestAccountBankStatementImportPayPal(common.TransactionCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super(TestAccountBankStatementImportPayPal, self).setUp()
|
||||||
|
|
||||||
self.now = fields.Datetime.now()
|
self.now = fields.Datetime.now()
|
||||||
self.currency_eur = self.env.ref('base.EUR')
|
self.currency_eur = self.env.ref('base.EUR')
|
||||||
@@ -47,7 +47,6 @@ class TestAccountBankStatementImportPayPal(common.TransactionCase):
|
|||||||
'name': 'PayPal',
|
'name': 'PayPal',
|
||||||
'type': 'bank',
|
'type': 'bank',
|
||||||
'code': 'PP',
|
'code': 'PP',
|
||||||
'currency_id': self.currency_usd.id,
|
|
||||||
})
|
})
|
||||||
wizard = self.AccountBankStatementImport.with_context({
|
wizard = self.AccountBankStatementImport.with_context({
|
||||||
'journal_id': journal.id,
|
'journal_id': journal.id,
|
||||||
@@ -119,7 +118,6 @@ class TestAccountBankStatementImportPayPal(common.TransactionCase):
|
|||||||
'name': 'PayPal',
|
'name': 'PayPal',
|
||||||
'type': 'bank',
|
'type': 'bank',
|
||||||
'code': 'PP',
|
'code': 'PP',
|
||||||
'currency_id': self.currency_usd.id,
|
|
||||||
})
|
})
|
||||||
wizard = self.AccountBankStatementImport.with_context({
|
wizard = self.AccountBankStatementImport.with_context({
|
||||||
'journal_id': journal.id,
|
'journal_id': journal.id,
|
||||||
@@ -143,7 +141,6 @@ class TestAccountBankStatementImportPayPal(common.TransactionCase):
|
|||||||
'name': 'PayPal',
|
'name': 'PayPal',
|
||||||
'type': 'bank',
|
'type': 'bank',
|
||||||
'code': 'PP',
|
'code': 'PP',
|
||||||
'currency_id': self.currency_usd.id,
|
|
||||||
})
|
})
|
||||||
wizard = self.AccountBankStatementImport.with_context({
|
wizard = self.AccountBankStatementImport.with_context({
|
||||||
'journal_id': journal.id,
|
'journal_id': journal.id,
|
||||||
@@ -163,39 +160,27 @@ class TestAccountBankStatementImportPayPal(common.TransactionCase):
|
|||||||
self.assertEqual(len(statement), 0)
|
self.assertEqual(len(statement), 0)
|
||||||
|
|
||||||
def test_import_activity_mapping_en(self):
|
def test_import_activity_mapping_en(self):
|
||||||
with common.Form(
|
wizard = self.AccountBankStatementImportPayPalMappingWizard.new({
|
||||||
self.AccountBankStatementImportPayPalMappingWizard) as form:
|
'filename': 'fixtures/activity_en.csv',
|
||||||
form.filename = 'fixtures/activity_en.csv'
|
'data_file': self._data_file('fixtures/activity_en.csv'),
|
||||||
form.data_file = self._data_file(
|
})
|
||||||
'fixtures/activity_en.csv'
|
wizard._onchange_data_file()
|
||||||
)
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
len(
|
len(self.AccountBankStatementImportPayPalMappingWizard
|
||||||
self.AccountBankStatementImportPayPalMappingWizard
|
.with_context(header=wizard.header).statement_columns()),
|
||||||
.with_context(
|
|
||||||
header=form.header,
|
|
||||||
).statement_columns()
|
|
||||||
),
|
|
||||||
22
|
22
|
||||||
)
|
)
|
||||||
wizard = form.save()
|
|
||||||
wizard.import_mapping()
|
wizard.import_mapping()
|
||||||
|
|
||||||
def test_import_statement_mapping_en(self):
|
def test_import_statement_mapping_en(self):
|
||||||
with common.Form(
|
wizard = self.AccountBankStatementImportPayPalMappingWizard.new({
|
||||||
self.AccountBankStatementImportPayPalMappingWizard) as form:
|
'filename': 'fixtures/statement_en.csv',
|
||||||
form.filename = 'fixtures/statement_en.csv'
|
'data_file': self._data_file('fixtures/statement_en.csv'),
|
||||||
form.data_file = self._data_file(
|
})
|
||||||
'fixtures/statement_en.csv'
|
wizard._onchange_data_file()
|
||||||
)
|
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
len(
|
len(self.AccountBankStatementImportPayPalMappingWizard
|
||||||
self.AccountBankStatementImportPayPalMappingWizard
|
.with_context(header=wizard.header).statement_columns()),
|
||||||
.with_context(
|
|
||||||
header=form.header,
|
|
||||||
).statement_columns()
|
|
||||||
),
|
|
||||||
18
|
18
|
||||||
)
|
)
|
||||||
wizard = form.save()
|
|
||||||
wizard.import_mapping()
|
wizard.import_mapping()
|
||||||
|
|||||||
@@ -143,12 +143,8 @@
|
|||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//div[@name='final_buttons']/button" position="attributes">
|
<xpath expr="//div[@name='states_buttons']/button" position="before">
|
||||||
<attribute name="class">btn-default</attribute>
|
<button name="import_mapping" string="Import" type="object" class="btn-primary" attrs="{'invisible': [('state', '=', 'final')]}" />
|
||||||
<attribute name="string">Cancel</attribute>
|
|
||||||
</xpath>
|
|
||||||
<xpath expr="//div[@name='final_buttons']/button" position="before">
|
|
||||||
<button name="import_mapping" string="Import" type="object" class="btn-primary" />
|
|
||||||
</xpath>
|
</xpath>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
web
|
web
|
||||||
server-ux
|
|
||||||
connector-jira
|
connector-jira
|
||||||
|
|||||||
Reference in New Issue
Block a user