Browse Source

[IMP] Extract description to README

Add OCA as author,
PEP8
pull/19/head
Laurent Mignon 9 years ago
committed by Laurent Mignon (ACSONE)
parent
commit
0550df383c
  1. 55
      account_bank_statement_import/README.rst
  2. 9
      account_bank_statement_import/__openerp__.py
  3. 4
      account_bank_statement_import/account_bank_statement_import.py
  4. 63
      account_bank_statement_import_ofx/README.rst
  5. 35
      account_bank_statement_import_ofx/__openerp__.py
  6. 4
      account_bank_statement_import_ofx/account_bank_statement_import_ofx.py
  7. 9
      account_bank_statement_import_ofx/tests/test_import_bank_statement.py
  8. 58
      account_bank_statement_import_qif/README.rst
  9. 27
      account_bank_statement_import_qif/__openerp__.py
  10. 22
      account_bank_statement_import_qif/account_bank_statement_import_qif.py

55
account_bank_statement_import/README.rst

@ -0,0 +1,55 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Account Bank Statement Import
=============================
This module add a generic wizard to import Bank Statements. It also extend
the bank account module to sanitize the account number and extend the search
method to use this field when searching on account_number.
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
Known issues / Roadmap
======================
* None
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/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 <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_bank_statement_import%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Odoo SA
* Pedro M. Baeza <pedro.baeza@gmail.com>
* Alexis de Lattre <alexis@via.ecp.fr>
* Laurent Mignon <laurent.mignon@acsone.eu>
* Ronald Portier <rportier@therp.nl>
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.

9
account_bank_statement_import/__openerp__.py

@ -3,13 +3,10 @@
'name': 'Account Bank Statement Import',
'category': 'Accounting & Finance',
'version': '1.0',
'author': 'OpenERP SA',
'author': 'OpenERP SA,'
'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/bank-statement-import',
'depends': ['account'],
'demo': [],
'description': """Generic Wizard to Import Bank Statements.
Backport from Odoo 9.0
""",
'data': [
'account_bank_statement_import_view.xml',
],

4
account_bank_statement_import/account_bank_statement_import.py

@ -9,7 +9,7 @@ import logging
_logger = logging.getLogger(__name__)
class account_bank_statement_line(models.Model):
class AccountBankStatementLine(models.Model):
_inherit = "account.bank.statement.line"
# Ensure transactions can be imported only once (if the import format
@ -23,7 +23,7 @@ class account_bank_statement_line(models.Model):
]
class account_bank_statement_import(models.TransientModel):
class AccountBankStatementImport(models.TransientModel):
_name = 'account.bank.statement.import'
_description = 'Import Bank Statement'

63
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 <http://pypi.python.org/pypi/ofxparse>`_
Known issues / Roadmap
======================
* None
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/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 <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_bank_statement_import_ofx%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Odoo SA
* Alexis de Lattre <alexis@via.ecp.fr>
* Laurent Mignon <laurent.mignon@acsone.eu>
* Ronald Portier <rportier@therp.nl>
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.

35
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,
}

4
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 = []

9
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'))

58
account_bank_statement_import_qif/README.rst

@ -0,0 +1,58 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Module to import QIF bank statements.
=====================================
This module allows you to import the machine readable QIF Files in Odoo: they are parsed and stored in human readable format in
Accounting \ Bank and Cash \ Bank Statements.
Important Note
---------------
Because of the QIF format limitation, we cannot ensure the same transactions aren't imported several times or handle multicurrency.
Whenever possible, you should use a more appropriate file format like OFX.
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
Known issues / Roadmap
======================
* None
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-statement-import/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 <https://github.com/OCA/bank-statement-import/issues/new?body=module:%20account_bank_statement_import_ofx%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits
=======
Contributors
------------
* Odoo SA
* Alexis de Lattre <alexis@via.ecp.fr>
* Laurent Mignon <laurent.mignon@acsone.eu>
* Ronald Portier <rportier@therp.nl>
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.

27
account_bank_statement_import_qif/__openerp__.py

@ -1,28 +1,19 @@
# -*- coding: utf-8 -*-
# noqa: This is a backport from Odoo. OCA has no control over style here.
# flake8: noqa
{
'name': 'Import QIF Bank Statement',
'category': 'Accounting & Finance',
'version': '1.0',
'author': 'OpenERP SA',
'description': '''
Module to import QIF bank statements.
======================================
This module allows you to import the machine readable QIF Files in Odoo: they are parsed and stored in human readable format in
Accounting \ Bank and Cash \ Bank Statements.
Important Note
---------------------------------------------
Because of the QIF format limitation, we cannot ensure the same transactions aren't imported several times or handle multicurrency.
Whenever possible, you should use a more appropriate file format like OFX.
''',
'author': 'OpenERP SA,'
'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/bank-statement-import',
'images': [],
'depends': ['account_bank_statement_import'],
'demo': [],
'data': ['account_bank_statement_import_qif_view.xml'],
'depends': [
'account_bank_statement_import'
],
'data': [
'account_bank_statement_import_qif_view.xml'
],
'auto_install': False,
'installable': True,
}

22
account_bank_statement_import_qif/account_bank_statement_import_qif.py

@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-
# noqa: This is a backport from Odoo. OCA has no control over style here.
# flake8: noqa
import dateutil.parser
import StringIO
@ -10,7 +8,7 @@ from openerp import api, models, fields
from openerp.exceptions import Warning
class account_bank_statement_import(models.TransientModel):
class AccountBankStatementImport(models.TransientModel):
_inherit = "account.bank.statement.import"
@api.model
@ -37,7 +35,7 @@ class account_bank_statement_import(models.TransientModel):
record = self.browse(active_id)
if record.journal_id:
record = record.with_context(journal_id=record.journal_id.id)
return super(account_bank_statement_import, record)._get_journal(
return super(AccountBankStatementImport, record)._get_journal(
currency_id, bank_account_id, account_number)
@api.model
@ -47,7 +45,7 @@ class account_bank_statement_import(models.TransientModel):
@api.model
def _parse_file(self, data_file):
if not self._check_qif(data_file):
return super(account_bank_statement_import, self)._parse_file(
return super(AccountBankStatementImport, self)._parse_file(
data_file)
try:
@ -80,9 +78,13 @@ class account_bank_statement_import(models.TransientModel):
elif line[0] == 'N': # Check number
vals_line['ref'] = line[1:]
elif line[0] == 'P': # Payee
vals_line['name'] = 'name' in vals_line and line[1:] + ': ' + vals_line['name'] or line[1:]
# Since QIF doesn't provide account numbers, we'll have to find res.partner and res.partner.bank here
# (normal behavious is to provide 'account_number', which the generic module uses to find partner/bank)
vals_line['name'] = ('name' in vals_line and
line[1:] + ': ' + vals_line['name'] or
line[1:])
# Since QIF doesn't provide account numbers, we'll have to
# find res.partner and res.partner.bank here
# (normal behavious is to provide 'account_number', which
# the generic module uses to find partner/bank)
banks = self.env['res.partner.bank'].search(
[('owner_name', '=', line[1:])], limit=1)
if banks:
@ -90,7 +92,9 @@ class account_bank_statement_import(models.TransientModel):
vals_line['bank_account_id'] = bank_account.id
vals_line['partner_id'] = bank_account.partner_id.id
elif line[0] == 'M': # Memo
vals_line['name'] = 'name' in vals_line and vals_line['name'] + ': ' + line[1:] or line[1:]
vals_line['name'] = ('name' in vals_line and
vals_line['name'] + ': ' + line[1:] or
line[1:])
elif line[0] == '^': # end of item
transactions.append(vals_line)
vals_line = {}

Loading…
Cancel
Save