Browse Source

clean up branch

pull/127/head
luc.demeyer@noviat.com 6 years ago
parent
commit
92df1d9639
  1. 54
      account_bank_statement_import_helper/README.rst
  2. 2
      account_bank_statement_import_helper/__init__.py
  3. 20
      account_bank_statement_import_helper/__manifest__.py
  4. BIN
      account_bank_statement_import_helper/static/description/icon.png
  5. 2
      account_bank_statement_import_helper/wizard/__init__.py
  6. 38
      account_bank_statement_import_helper/wizard/account_bank_statement_import.py

54
account_bank_statement_import_helper/README.rst

@ -0,0 +1,54 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
============================
Bank statement import helper
============================
This module enhances the standard bank statement import as follows:
- support for local bank accounts as subset of IBAN accounts.
Installation
============
There is no specific installation procedure for this module.
Configuration and Usage
=======================
.. 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/10.0
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 smash it by providing detailed and welcomed feedback.
Credits
=======
Contributors
------------
* Luc De Meyer <luc.demeyer@noviat.com>
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.

2
account_bank_statement_import_helper/__init__.py

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import wizard

20
account_bank_statement_import_helper/__manifest__.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2009-2017 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Bank statement import helper',
'version': '10.0.1.0.0',
'category': 'Accounting & Finance',
'summary': """
Generic bank statement import improvements.
""",
'author': 'Noviat,'
'Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/bank-statement-import',
'depends': [
'account_bank_statement_import',
],
'installable': True,
'license': 'AGPL-3',
}

BIN
account_bank_statement_import_helper/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

2
account_bank_statement_import_helper/wizard/__init__.py

@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import account_bank_statement_import

38
account_bank_statement_import_helper/wizard/account_bank_statement_import.py

@ -0,0 +1,38 @@
# -*- coding: utf-8 -*-
# Copyright 2009-2017 Noviat.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
from odoo.addons.base.res.res_bank import sanitize_account_number
class AccountBankStatementImport(models.TransientModel):
"""
add support for local bank account numbers which are in several
countries a subset of the IBAN
"""
_inherit = 'account.bank.statement.import'
def _find_additional_data(self, currency_code, account_number):
currency, journal = super(
AccountBankStatementImport, self
)._find_additional_data(currency_code, account_number)
if not journal:
sanitized_account_number = sanitize_account_number(account_number)
fin_journals = self.env['account.journal'].search(
[('type', '=', 'bank')])
fin_journal = fin_journals.filtered(
lambda r: sanitized_account_number
in r.bank_account_id.sanitized_acc_number)
if len(fin_journal) == 1:
journal = fin_journal
return currency, journal
def _check_journal_bank_account(self, journal, account_number):
check = super(
AccountBankStatementImport, self
)._check_journal_bank_account(journal, account_number)
if not check:
check = account_number \
in journal.bank_account_id.sanitized_acc_number
return check
Loading…
Cancel
Save