diff --git a/account_bank_statement_import/__openerp__.py b/account_bank_statement_import/__openerp__.py index 31df646c..6961e9a5 100644 --- a/account_bank_statement_import/__openerp__.py +++ b/account_bank_statement_import/__openerp__.py @@ -2,14 +2,14 @@ { 'name': 'Account Bank Statement Import', 'category': 'Banking addons', - 'version': '8.0.1.0.1', + 'version': '8.0.1.0.2', 'license': 'AGPL-3', 'author': 'OpenERP SA,' 'Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/bank-statement-import', 'depends': ['account'], 'data': [ - "views/account_config_settings.xml", + 'views/account_config_settings.xml', 'views/account_bank_statement_import_view.xml', ], 'demo': [ diff --git a/account_bank_statement_import/models/account_bank_statement_import.py b/account_bank_statement_import/models/account_bank_statement_import.py index 47a6f56a..a9e07f1d 100644 --- a/account_bank_statement_import/models/account_bank_statement_import.py +++ b/account_bank_statement_import/models/account_bank_statement_import.py @@ -144,8 +144,9 @@ class AccountBankStatementImport(models.TransientModel): currency_id = self._find_currency_id(currency_code) bank_account_id = self._find_bank_account_id(account_number) if not bank_account_id and account_number: - raise Warning(_('Can not find the account number %s.') % - account_number) + raise UserError( + _('Can not find the account number %s.') % account_number + ) # Find the bank journal journal_id = self._get_journal(currency_id, bank_account_id) # By now journal and account_number must be known diff --git a/account_bank_statement_import/tests/test_import_bank_statement.py b/account_bank_statement_import/tests/test_import_bank_statement.py index e32051a4..42021ab8 100644 --- a/account_bank_statement_import/tests/test_import_bank_statement.py +++ b/account_bank_statement_import/tests/test_import_bank_statement.py @@ -23,7 +23,7 @@ # ############################################################################## from openerp.tests.common import TransactionCase -from openerp.exceptions import Warning +from openerp.exceptions import Warning as UserError class TestAccountBankStatementImport(TransactionCase): @@ -68,12 +68,12 @@ class TestAccountBankStatementImport(TransactionCase): stmt_vals = { 'currency_code': 'EUR', 'account_number': '123456789'} - with self.assertRaises(Warning) as e: + with self.assertRaises(UserError) as e: self.statement_import_model._import_statement(stmt_vals.copy()) self.assertEqual(e.exception.message, 'Can not find the account number 123456789.') self.statement_import_model._create_bank_account('123456789') - with self.assertRaises(Warning) as e: + with self.assertRaises(UserError) as e: self.statement_import_model._import_statement(stmt_vals.copy()) self.assertEqual(e.exception.message, 'Can not determine journal for import.') diff --git a/account_bank_statement_import_camt/__openerp__.py b/account_bank_statement_import_camt/__openerp__.py index 47113f36..d54abd61 100644 --- a/account_bank_statement_import_camt/__openerp__.py +++ b/account_bank_statement_import_camt/__openerp__.py @@ -19,7 +19,7 @@ ############################################################################## { 'name': 'CAMT Format Bank Statements Import', - 'version': '8.0.0.3.0', + 'version': '8.0.1.0.4', 'license': 'AGPL-3', 'author': 'Odoo Community Association (OCA), Therp BV', 'website': 'https://github.com/OCA/bank-statement-import', diff --git a/account_bank_statement_import_mt940_base/__openerp__.py b/account_bank_statement_import_mt940_base/__openerp__.py index c701d421..d821ce37 100644 --- a/account_bank_statement_import_mt940_base/__openerp__.py +++ b/account_bank_statement_import_mt940_base/__openerp__.py @@ -19,7 +19,7 @@ ############################################################################## { 'name': 'MT940 Bank Statements Import', - 'version': '8.0.1.1.0', + 'version': '8.0.1.1.1', 'license': 'AGPL-3', 'author': 'Odoo Community Association (OCA), Therp BV', 'website': 'https://github.com/OCA/bank-statement-import', diff --git a/account_bank_statement_import_mt940_nl_ing/README.rst b/account_bank_statement_import_mt940_nl_ing/README.rst index 631543d2..2f9107ec 100644 --- a/account_bank_statement_import_mt940_nl_ing/README.rst +++ b/account_bank_statement_import_mt940_nl_ing/README.rst @@ -7,7 +7,7 @@ Import MT940 IBAN ING Bank Statements This module allows you to import the MT940 IBAN files from the Dutch ING bank in Odoo as bank statements. The specifications are published at: - https://www.ing.nl/media/ING_ming_mt940s_24_juli_tcm162-46356.pdf +https://www.ing.nl/media/ING_ming_mt940s_24_juli_tcm162-46356.pdf and were last updated august 2014. Known issues / Roadmap diff --git a/account_bank_statement_import_mt940_nl_ing/__openerp__.py b/account_bank_statement_import_mt940_nl_ing/__openerp__.py index fa91932d..6cad8a5c 100644 --- a/account_bank_statement_import_mt940_nl_ing/__openerp__.py +++ b/account_bank_statement_import_mt940_nl_ing/__openerp__.py @@ -19,7 +19,7 @@ ############################################################################## { 'name': 'MT940 IBAN ING Format Bank Statements Import', - 'version': '8.0.0.3.0', + 'version': '8.0.1.0.4', 'license': 'AGPL-3', 'author': 'Odoo Community Association (OCA), Therp BV', 'website': 'https://github.com/OCA/bank-statement-import', diff --git a/account_bank_statement_import_mt940_nl_rabo/__openerp__.py b/account_bank_statement_import_mt940_nl_rabo/__openerp__.py index c01e7e3d..90f0239b 100644 --- a/account_bank_statement_import_mt940_nl_rabo/__openerp__.py +++ b/account_bank_statement_import_mt940_nl_rabo/__openerp__.py @@ -19,7 +19,8 @@ ############################################################################## { 'name': 'MT940 import for dutch Rabobank', - 'version': '8.0.1.1.0', + 'version': '8.0.1.1.1', + 'license': 'AGPL-3', 'author': 'Odoo Community Association (OCA), Therp BV', 'website': 'https://github.com/OCA/bank-statement-import', 'category': 'Banking addons', diff --git a/account_bank_statement_import_ofx/__openerp__.py b/account_bank_statement_import_ofx/__openerp__.py index 329859e7..6d9c3278 100644 --- a/account_bank_statement_import_ofx/__openerp__.py +++ b/account_bank_statement_import_ofx/__openerp__.py @@ -1,8 +1,9 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- { 'name': 'Import OFX Bank Statement', 'category': 'Banking addons', - 'version': '8.0.1.0.0', + 'version': '8.0.1.0.1', + 'license': 'AGPL-3', 'author': 'OpenERP SA,' 'Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/bank-statement-import', 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 9358ae12..b03af725 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 @@ -5,7 +5,7 @@ import StringIO from openerp import api, models from openerp.tools.translate import _ -from openerp.exceptions import Warning +from openerp.exceptions import Warning as UserError _logger = logging.getLogger(__name__) @@ -64,8 +64,10 @@ class AccountBankStatementImport(models.TransientModel): total_amt += float(transaction.amount) transactions.append(vals_line) except Exception, e: - raise Warning(_("The following problem occurred during import. " - "The file might not be valid.\n\n %s" % e.message)) + raise UserError(_( + "The following problem occurred during import. " + "The file might not be valid.\n\n %s" % e.message + )) vals_bank_statement = { 'name': ofx.account.routing_number, diff --git a/account_bank_statement_import_qif/__openerp__.py b/account_bank_statement_import_qif/__openerp__.py index 14a81a06..fb33246e 100644 --- a/account_bank_statement_import_qif/__openerp__.py +++ b/account_bank_statement_import_qif/__openerp__.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- - { 'name': 'Import QIF Bank Statement', 'category': 'Banking addons', - 'version': '8.0.1.0.0', + 'version': '8.0.1.0.1', + 'license': 'AGPL-3', 'author': 'OpenERP SA,' 'Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/bank-statement-import', diff --git a/account_bank_statement_import_qif/account_bank_statement_import_qif.py b/account_bank_statement_import_qif/account_bank_statement_import_qif.py index 0b9061e4..b217e65b 100644 --- a/account_bank_statement_import_qif/account_bank_statement_import_qif.py +++ b/account_bank_statement_import_qif/account_bank_statement_import_qif.py @@ -5,7 +5,7 @@ import StringIO from openerp.tools.translate import _ from openerp import api, models -from openerp.exceptions import Warning +from openerp.exceptions import Warning as UserError class AccountBankStatementImport(models.TransientModel): @@ -36,7 +36,7 @@ class AccountBankStatementImport(models.TransientModel): header = data_list[0].strip() header = header.split(":")[1] except: - raise Warning(_('Could not decipher the QIF file.')) + raise UserError(_('Could not decipher the QIF file.')) transactions = [] vals_line = {} total = 0 @@ -80,8 +80,10 @@ class AccountBankStatementImport(models.TransientModel): else: pass else: - raise Warning(_('This file is either not a bank statement or is ' - 'not correctly formed.')) + raise UserError(_( + "This file is either not a bank statement or is " + "not correctly formed." + )) vals_bank_statement.update({ 'balance_end_real': total, diff --git a/account_bank_statement_import_save_file/__openerp__.py b/account_bank_statement_import_save_file/__openerp__.py index bdf5a388..20c735c1 100644 --- a/account_bank_statement_import_save_file/__openerp__.py +++ b/account_bank_statement_import_save_file/__openerp__.py @@ -1,8 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution -# This module copyright (C) 2015 Therp BV . +# Copyright (C) 2015 Therp BV . # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -19,27 +18,20 @@ # ############################################################################## { - "name": "Save imported bank statements", - "version": "8.0.1.0.0", - "author": "Therp BV", - "license": "AGPL-3", - "category": "Accounting & Finance", - "summary": "Keep imported bank statements as raw data", - "depends": [ + 'name': 'Save imported bank statements', + 'version': '8.0.1.0.1', + 'author': 'Odoo Community Association (OCA), Therp BV', + 'license': 'AGPL-3', + 'category': 'Banking addons', + 'summary': 'Keep imported bank statements as raw data', + 'depends': [ 'account_bank_statement_import', ], - "data": [ - "views/account_bank_statement.xml", + 'data': [ + 'views/account_bank_statement.xml', ], - "qweb": [ - ], - "test": [ - ], - "post_init_hook": '_post_init_hook', - "auto_install": False, - "installable": True, - "application": False, - "external_dependencies": { - 'python': [], - }, + 'post_init_hook': '_post_init_hook', + 'auto_install': False, + 'installable': True, + 'application': False, } diff --git a/bank_statement_parse_camt/test_files/test-camt053.zip b/bank_statement_parse_camt/test_files/test-camt053.zip deleted file mode 100644 index ccf5b3c2..00000000 Binary files a/bank_statement_parse_camt/test_files/test-camt053.zip and /dev/null differ diff --git a/base_bank_account_number_unique/README.rst b/base_bank_account_number_unique/README.rst index d5dd3f29..9c3dc231 100644 --- a/base_bank_account_number_unique/README.rst +++ b/base_bank_account_number_unique/README.rst @@ -1,20 +1,35 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg :alt: License: AGPL-3 + Unique bank account numbers =========================== -It can be desirable to be able to rely on a bank account number identifying exactly one partner. This module allows you to enforce this, so that an account number is unique in the system. +It can be desirable to be able to rely on a bank account number identifying +exactly one partner. This module allows you to enforce this, so that an +account number is unique in the system. Installation ============ -During installation, the module checks if your bank account numbers are unique already. If this is not the case, you won't be able to install the module until duplicates are fixed. +During installation, the module checks if your bank account numbers are +unique already. If this is not the case, you won't be able to install the +module until duplicates are fixed. -The error message only shows the first few duplicates, in order to find all of them, use the following statement:: +The error message only shows the first few duplicates, in order to find all +of them, use the following statement:: - with res_partner_bank_sanitized as (select id, acc_number, regexp_replace(acc_number, '\W+', '', 'g') acc_number_sanitized from res_partner_bank), - res_partner_bank_sanitized_grouped as (select array_agg(id) ids, acc_number_sanitized, count(*) amount from res_partner_bank_sanitized group by acc_number_sanitized) - select * from res_partner_bank_sanitized_grouped where amount > 1; + with res_partner_bank_sanitized as ( + select + id, acc_number, + regexp_replace(acc_number, '\W+', '', 'g') acc_number_sanitized + from res_partner_bank + ), + res_partner_bank_sanitized_grouped as ( + select + array_agg(id) ids, acc_number_sanitized, count(*) amount + from res_partner_bank_sanitized group by acc_number_sanitized + ) + select * from res_partner_bank_sanitized_grouped where amount > 1; Bug Tracker =========== diff --git a/base_bank_account_number_unique/__openerp__.py b/base_bank_account_number_unique/__openerp__.py index 9e6f23d5..95a83089 100644 --- a/base_bank_account_number_unique/__openerp__.py +++ b/base_bank_account_number_unique/__openerp__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## # -# This module copyright (C) 2015 Therp BV . +# Copyright (C) 2015 Therp BV . # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -18,16 +18,16 @@ # ############################################################################## { - "name": "Unique bank account numbers", - "version": "8.0.1.0.0", - "author": "Therp BV,Odoo Community Association (OCA)", - "license": "AGPL-3", - "category": "Accounting & Finance", - "summary": "Enforce uniqueness on bank accounts", - "depends": [ + 'name': 'Unique bank account numbers', + 'version': '8.0.1.0.1', + 'author': 'Therp BV, Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'category': 'Banking addons', + 'summary': 'Enforce uniqueness on bank accounts', + 'depends': [ 'account_bank_statement_import', ], - "post_init_hook": "post_init_hook", - "auto_install": False, - "installable": True, + 'post_init_hook': 'post_init_hook', + 'auto_install': False, + 'installable': True, } diff --git a/base_bank_account_number_unique/hooks.py b/base_bank_account_number_unique/hooks.py index 8bcdca36..a8fdb763 100644 --- a/base_bank_account_number_unique/hooks.py +++ b/base_bank_account_number_unique/hooks.py @@ -17,11 +17,12 @@ # along with this program. If not, see . # ############################################################################## -from openerp import _, SUPERUSER_ID, exceptions +from openerp import _, SUPERUSER_ID +from openerp.exceptions import Warning as UserError def post_init_hook(cr, pool): - '''check if your constraint was actually inserted, raise otherwise''' + """check if your constraint was actually inserted, raise otherwise""" if not pool['ir.model.constraint'].search(cr, SUPERUSER_ID, [ ('name', '=', 'res_partner_bank_unique_number'), ('model.model', '=', 'res.partner.bank'), @@ -51,4 +52,4 @@ def post_init_hook(cr, pool): max_account_numbers, '\n'.join(duplicates), max_account_numbers, ) - raise exceptions.Warning(message) + raise UserError(message) diff --git a/base_bank_account_number_unique/tests/test_base_bank_account_number_unique.py b/base_bank_account_number_unique/tests/test_base_bank_account_number_unique.py index de36ea9f..0c87638f 100644 --- a/base_bank_account_number_unique/tests/test_base_bank_account_number_unique.py +++ b/base_bank_account_number_unique/tests/test_base_bank_account_number_unique.py @@ -18,7 +18,7 @@ # ############################################################################## from openerp.tests.common import TransactionCase -from openerp import exceptions +from openerp.exceptions import Warning as UserError from ..hooks import post_init_hook @@ -38,5 +38,5 @@ class TestBaseBankAccountNumberUnique(TransactionCase): 'acc_number': 'BE 1234 567 890', 'state': 'bank', }) - with self.assertRaises(exceptions.Warning): + with self.assertRaises(UserError): post_init_hook(self.cr, self.registry)