[ADD] Module base_iban_bic_not_required

This commit is contained in:
Stefan Rijnhart
2013-07-24 16:57:44 +02:00
parent 5190d28459
commit f8f0ae56ef
4 changed files with 83 additions and 0 deletions

View File

@@ -0,0 +1 @@
import model

View File

@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Therp BV (<http://therp.nl>).
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'IBAN - Bic not required',
'version': '0.1',
'license': 'AGPL-3',
'author': 'Banking addons community',
'website': 'https://launchpad.net/banking-addons',
'category': 'Banking addons',
'depends': [
'base_iban',
],
'description': '''
The account_iban module in OpenERP 6.1 mandates the presence of a BIC
code on an IBAN account number through a constraint. However, as of
Februari 2012 there is a resolution from the EU that drops this requirement
(see section 8 of [1]). This module reverts the constraint on BICs from the
base_iban module.
See also https://bugs.launchpad.net/openobject-addons/+bug/933472
[1] http://www.europarl.europa.eu/sides/getDoc.do?pubRef=-//EP//TEXT+TA+P7-TA-2012-0037+0+DOC+XML+V0//EN&language=EN#BKMD-9
''',
'installable': True,
}

View File

@@ -0,0 +1 @@
import res_partner_bank

View File

@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Therp BV (<http://therp.nl>).
# All Rights Reserved
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import orm
class res_partner_bank(orm.Model):
_inherit = 'res.partner.bank'
def _check_bank(self, cr, uid, ids, context=None):
#suppress base_iban's constraint to enforce BICs for IBANs
#workaround for lp:933472
return True
_constraints = [
# Cannot have this as a constraint as it is rejecting valid numbers from GB and DE
# It works much better without this constraint!
#(check_iban, _("The IBAN number doesn't seem to be correct"), ["acc_number"])
(_check_bank, '\nPlease define BIC/Swift code on bank for bank type IBAN Account to make valid payments', ['bic'])
]