[MIG] account_bank_statement_import_ofx : Migration to V12

This commit is contained in:
remi-filament
2019-06-04 15:39:26 +02:00
committed by Alexis de Lattre
parent 862f5bf0fc
commit 413c084bb2
6 changed files with 22 additions and 3 deletions

View File

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

View File

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

View File

@@ -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': [

View File

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

View File

@@ -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

View File

@@ -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(