From 47dadc733280be1549d9f8f997802eef26e31815 Mon Sep 17 00:00:00 2001 From: Laurent Mignon Date: Fri, 5 Jun 2015 12:31:08 +0200 Subject: [PATCH] [IMP] Extract description to README Add OCA as author, PEP8 --- account_bank_statement_import_ofx/README.rst | 63 +++++++++++++++++++ .../__openerp__.py | 35 +++-------- .../account_bank_statement_import_ofx.py | 4 +- .../tests/test_import_bank_statement.py | 9 --- 4 files changed, 75 insertions(+), 36 deletions(-) create mode 100644 account_bank_statement_import_ofx/README.rst diff --git a/account_bank_statement_import_ofx/README.rst b/account_bank_statement_import_ofx/README.rst new file mode 100644 index 0000000..6fb1260 --- /dev/null +++ b/account_bank_statement_import_ofx/README.rst @@ -0,0 +1,63 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License: AGPL-3 + +Import OFX Bank Statement +========================= + +This module allows you to import the machine readable OFX Files in Odoo: they are parsed and stored in human readable format in +Accounting \ Bank and Cash \ Bank Statements. + +Bank Statements may be generated containing a subset of the OFX information (only those transaction lines that are required for the +creation of the Financial Accounting records). + +The module has been initiated by a backport of the new framework developed +by Odoo for V9 at its early stage. It's no more kept in sync with the V9 since +it has reach a stage where maintaining a pure backport of 9.0 in 8.0 is not +feasible anymore + +Installation +============ + +The module requires one additional python lib: + +* `ofxparse `_ + +Known issues / Roadmap +====================== + +* None + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + + +Credits +======= + +Contributors +------------ + +* Odoo SA +* Alexis de Lattre +* Laurent Mignon +* Ronald Portier + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/account_bank_statement_import_ofx/__openerp__.py b/account_bank_statement_import_ofx/__openerp__.py index 8832984..212ac31 100644 --- a/account_bank_statement_import_ofx/__openerp__.py +++ b/account_bank_statement_import_ofx/__openerp__.py @@ -1,32 +1,17 @@ # -*- encoding: utf-8 -*- -# noqa: This is a backport from Odoo. OCA has no control over style here. -# flake8: noqa { 'name': 'Import OFX Bank Statement', - 'category' : 'Accounting & Finance', + 'category': 'Accounting & Finance', 'version': '1.0', - 'author': 'OpenERP SA', - 'depends': ['account_bank_statement_import'], - 'demo': [], - 'description' : """ -Module to import OFX bank statements. -====================================== - -This module allows you to import the machine readable OFX Files in Odoo: they are parsed and stored in human readable format in -Accounting \ Bank and Cash \ Bank Statements. - -Bank Statements may be generated containing a subset of the OFX information (only those transaction lines that are required for the -creation of the Financial Accounting records). - -Backported from Odoo 9.0 - -When testing with the provided test file, make sure the demo data from the -base account_bank_statement_import module has been imported, or manually -create periods for the year 2013. - """, - 'data' : [], - 'depends': ['account_bank_statement_import'], - 'demo': [], + 'author': 'OpenERP SA,' + 'Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/bank-statement-import', + 'depends': [ + 'account_bank_statement_import' + ], + 'external_dependencies': { + 'python': ['ofxparse'], + }, 'auto_install': True, 'installable': True, } diff --git a/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py b/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py index 93c8931..9358ae1 100644 --- a/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py +++ b/account_bank_statement_import_ofx/account_bank_statement_import_ofx.py @@ -16,7 +16,7 @@ except ImportError: ofxparser = None -class account_bank_statement_import(models.TransientModel): +class AccountBankStatementImport(models.TransientModel): _inherit = 'account.bank.statement.import' @api.model @@ -33,7 +33,7 @@ class account_bank_statement_import(models.TransientModel): def _parse_file(self, data_file): ofx = self._check_ofx(data_file) if not ofx: - return super(account_bank_statement_import, self)._parse_file( + return super(AccountBankStatementImport, self)._parse_file( data_file) transactions = [] 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 ad54f3d..b35afa1 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,4 @@ # -*- coding: utf-8 -*- -# noqa: This is a backport from Odoo. OCA has no control over style here. -# flake8: noqa from openerp.tests.common import TransactionCase from openerp.modules.module import get_module_resource @@ -16,12 +14,6 @@ class TestOfxFile(TransactionCase): self.bank_statement_model = self.env['account.bank.statement'] def test_ofx_file_import(self): - try: - from ofxparse import OfxParser as ofxparser - except ImportError: - # the Python library isn't installed on the server, the OFX import - # is unavailable and the test cannot be run - return True ofx_file_path = get_module_resource( 'account_bank_statement_import_ofx', 'test_ofx_file', 'test_ofx.ofx') @@ -41,4 +33,3 @@ class TestOfxFile(TransactionCase): self.assertEquals( line.bank_account_id.id, self.ref('account_bank_statement_import.ofx_partner_bank_1')) -