Browse Source

[MIG] account_bank_statement_import_ofx : Migration to V12

pull/200/head
remi-filament 6 years ago
parent
commit
fb19ad3dc0
  1. 1
      account_bank_statement_import_ofx/README.rst
  2. 1
      account_bank_statement_import_ofx/__init__.py
  3. 3
      account_bank_statement_import_ofx/__manifest__.py
  4. 1
      account_bank_statement_import_ofx/models/__init__.py
  5. 14
      account_bank_statement_import_ofx/models/account_journal.py
  6. 5
      account_bank_statement_import_ofx/tests/test_import_bank_statement.py

1
account_bank_statement_import_ofx/README.rst

@ -49,6 +49,7 @@ Contributors
* Ronald Portier <rportier@therp.nl> * Ronald Portier <rportier@therp.nl>
* Sylvain LE GAL <https://twitter.com/legalsylvain> * Sylvain LE GAL <https://twitter.com/legalsylvain>
* Nicolas JEUDY <https://github.com/njeudy> * Nicolas JEUDY <https://github.com/njeudy>
* Le Filament <https://github.com/lefilament>
Maintainer Maintainer
---------- ----------

1
account_bank_statement_import_ofx/__init__.py

@ -1 +1,2 @@
from . import models
from . import wizard from . import wizard

3
account_bank_statement_import_ofx/__manifest__.py

@ -1,13 +1,14 @@
{ {
'name': 'Import OFX Bank Statement', 'name': 'Import OFX Bank Statement',
'category': 'Banking addons', 'category': 'Banking addons',
'version': '11.0.1.0.0',
'version': '12.0.1.0.0',
'license': 'AGPL-3', 'license': 'AGPL-3',
'author': 'Odoo SA,' 'author': 'Odoo SA,'
'Akretion,' 'Akretion,'
'La Louve,' 'La Louve,'
'GRAP,' 'GRAP,'
'Nicolas JEUDY,' 'Nicolas JEUDY,'
'Le Filament,'
'Odoo Community Association (OCA)', 'Odoo Community Association (OCA)',
'website': 'https://odoo-community.org/', 'website': 'https://odoo-community.org/',
'depends': [ 'depends': [

1
account_bank_statement_import_ofx/models/__init__.py

@ -0,0 +1 @@
from . import account_journal

14
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

5
account_bank_statement_import_ofx/tests/test_import_bank_statement.py

@ -1,6 +1,7 @@
from odoo.tests.common import TransactionCase from odoo.tests.common import TransactionCase
from odoo.modules.module import get_module_resource from odoo.modules.module import get_module_resource
import base64 import base64
import datetime
class TestOfxFile(TransactionCase): class TestOfxFile(TransactionCase):
@ -68,8 +69,8 @@ class TestOfxFile(TransactionCase):
line = self.absl_model.search([ line = self.absl_model.search([
('name', '=', 'Agrolait'), ('name', '=', 'Agrolait'),
('statement_id', '=', bank_st_record.id)])[0] ('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): def test_check_journal_bank_account(self):
ofx_file_path = get_module_resource( ofx_file_path = get_module_resource(

Loading…
Cancel
Save