diff --git a/account_bank_statement_import_ofx/README.rst b/account_bank_statement_import_ofx/README.rst index 8435430..48ce1f7 100644 --- a/account_bank_statement_import_ofx/README.rst +++ b/account_bank_statement_import_ofx/README.rst @@ -49,6 +49,7 @@ Contributors * Ronald Portier * Sylvain LE GAL * Nicolas JEUDY +* Le Filament Maintainer ---------- diff --git a/account_bank_statement_import_ofx/__init__.py b/account_bank_statement_import_ofx/__init__.py index 4027237..9b42961 100644 --- a/account_bank_statement_import_ofx/__init__.py +++ b/account_bank_statement_import_ofx/__init__.py @@ -1 +1,2 @@ +from . import models from . import wizard diff --git a/account_bank_statement_import_ofx/__manifest__.py b/account_bank_statement_import_ofx/__manifest__.py index d4305e7..d1131d4 100644 --- a/account_bank_statement_import_ofx/__manifest__.py +++ b/account_bank_statement_import_ofx/__manifest__.py @@ -1,13 +1,14 @@ { 'name': 'Import OFX Bank Statement', 'category': 'Banking addons', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'license': 'AGPL-3', 'author': 'Odoo SA,' 'Akretion,' 'La Louve,' 'GRAP,' 'Nicolas JEUDY,' + 'Le Filament,' 'Odoo Community Association (OCA)', 'website': 'https://odoo-community.org/', 'depends': [ diff --git a/account_bank_statement_import_ofx/models/__init__.py b/account_bank_statement_import_ofx/models/__init__.py new file mode 100644 index 0000000..e18569e --- /dev/null +++ b/account_bank_statement_import_ofx/models/__init__.py @@ -0,0 +1 @@ +from . import account_journal \ No newline at end of file diff --git a/account_bank_statement_import_ofx/models/account_journal.py b/account_bank_statement_import_ofx/models/account_journal.py new file mode 100644 index 0000000..83c5fb5 --- /dev/null +++ b/account_bank_statement_import_ofx/models/account_journal.py @@ -0,0 +1,14 @@ +from odoo import models + + +class AccountJournal(models.Model): + _inherit = "account.journal" + + def _get_bank_statements_available_import_formats(self): + """ Adds ofx to supported import formats. + """ + rslt = super( + AccountJournal, + self)._get_bank_statements_available_import_formats() + rslt.append('ofx') + return rslt diff --git a/account_bank_statement_import_ofx/tests/test_import_bank_statement.py b/account_bank_statement_import_ofx/tests/test_import_bank_statement.py index 095dd70..5bbf923 100644 --- a/account_bank_statement_import_ofx/tests/test_import_bank_statement.py +++ b/account_bank_statement_import_ofx/tests/test_import_bank_statement.py @@ -1,6 +1,7 @@ from odoo.tests.common import TransactionCase from odoo.modules.module import get_module_resource import base64 +import datetime class TestOfxFile(TransactionCase): @@ -68,8 +69,8 @@ class TestOfxFile(TransactionCase): line = self.absl_model.search([ ('name', '=', 'Agrolait'), ('statement_id', '=', bank_st_record.id)])[0] - self.assertEquals(line.ref, '219378') - self.assertEquals(line.date, '2013-08-24') + self.assertEqual(line.ref, '219378') + self.assertEqual(line.date, datetime.date(2013, 8, 24)) def test_check_journal_bank_account(self): ofx_file_path = get_module_resource(