diff --git a/account_bank_statement_import_qif/README.rst b/account_bank_statement_import_qif/README.rst index 5707836..f971f70 100644 --- a/account_bank_statement_import_qif/README.rst +++ b/account_bank_statement_import_qif/README.rst @@ -26,14 +26,14 @@ Usage To use this module, you need to: -#. Go to *Accounting* dashboard. +#. Go to *Invoicing / Accounting* dashboard. #. Click on *Import statement* from any of the bank journals. #. Select a QIF file. #. Press *Import*. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/174/9.0 + :target: https://runbot.odoo-community.org/runbot/174/11.0 Bug Tracker =========== @@ -50,11 +50,15 @@ Credits Contributors ------------ -* Odoo SA -* Alexis de Lattre -* Laurent Mignon -* Ronald Portier -* Pedro M. Baeza +* Odoo SA +* Akretion + * Alexis de Lattre +* ACSONE A/V + * Laurent Mignon +* Therp + * Ronald Portier +* Tecnativa (https://www.tecnativa.com) + * Pedro M. Baeza Maintainer ---------- diff --git a/account_bank_statement_import_qif/__init__.py b/account_bank_statement_import_qif/__init__.py index 0796ed1..fbadf7a 100644 --- a/account_bank_statement_import_qif/__init__.py +++ b/account_bank_statement_import_qif/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import wizards diff --git a/account_bank_statement_import_qif/__manifest__.py b/account_bank_statement_import_qif/__manifest__.py index 35f3e42..b70b5a8 100644 --- a/account_bank_statement_import_qif/__manifest__.py +++ b/account_bank_statement_import_qif/__manifest__.py @@ -1,14 +1,13 @@ -# -*- coding: utf-8 -*- # Copyright 2015 Odoo S. A. # Copyright 2015 Laurent Mignon # Copyright 2015 Ronald Portier -# Copyright 2016 Pedro M. Baeza +# Copyright 2016-2017 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Import QIF Bank Statements', 'category': 'Accounting', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'author': 'OpenERP SA,' 'Tecnativa,' 'Odoo Community Association (OCA)', diff --git a/account_bank_statement_import_qif/tests/__init__.py b/account_bank_statement_import_qif/tests/__init__.py index 9ce25a7..25ee5b4 100644 --- a/account_bank_statement_import_qif/tests/__init__.py +++ b/account_bank_statement_import_qif/tests/__init__.py @@ -1,2 +1,3 @@ -# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from . import test_import_bank_statement diff --git a/account_bank_statement_import_qif/tests/test_import_bank_statement.py b/account_bank_statement_import_qif/tests/test_import_bank_statement.py index 8614602..b5269e2 100644 --- a/account_bank_statement_import_qif/tests/test_import_bank_statement.py +++ b/account_bank_statement_import_qif/tests/test_import_bank_statement.py @@ -1,12 +1,12 @@ -# -*- coding: utf-8 -*- # Copyright 2015 Odoo S. A. # Copyright 2015 Laurent Mignon # Copyright 2015 Ronald Portier -# Copyright 2016 Pedro M. Baeza +# Copyright 2016-2017 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.tests.common import TransactionCase from odoo.modules.module import get_module_resource +import base64 class TestQifFile(TransactionCase): @@ -32,7 +32,7 @@ class TestQifFile(TransactionCase): qif_file_path = get_module_resource( 'account_bank_statement_import_qif', 'tests', 'test_qif.qif', ) - qif_file = open(qif_file_path, 'rb').read().encode('base64') + qif_file = base64.b64encode(open(qif_file_path, 'rb').read()) wizard = self.statement_import_model.with_context( journal_id=self.journal.id ).create( diff --git a/account_bank_statement_import_qif/wizards/__init__.py b/account_bank_statement_import_qif/wizards/__init__.py index f82d76e..448bfc6 100644 --- a/account_bank_statement_import_qif/wizards/__init__.py +++ b/account_bank_statement_import_qif/wizards/__init__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import account_bank_statement_import_qif diff --git a/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py b/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py index 4eb7058..aa73165 100644 --- a/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py +++ b/account_bank_statement_import_qif/wizards/account_bank_statement_import_qif.py @@ -1,11 +1,9 @@ -# -*- coding: utf-8 -*- # Copyright 2015 Odoo S. A. # Copyright 2015 Laurent Mignon # Copyright 2015 Ronald Portier -# Copyright 2016 Pedro M. Baeza +# Copyright 2016-2017 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -import StringIO import dateutil.parser from odoo.tools.translate import _ @@ -18,16 +16,14 @@ class AccountBankStatementImport(models.TransientModel): @api.model def _check_qif(self, data_file): - return data_file.strip().startswith('!Type:') + return data_file.strip().startswith(b'!Type:') def _parse_file(self, data_file): if not self._check_qif(data_file): return super(AccountBankStatementImport, self)._parse_file( data_file) try: - file_data = "" - for line in StringIO.StringIO(data_file).readlines(): - file_data += line + file_data = data_file.decode() if '\r' in file_data: data_list = file_data.split('\r') else: