diff --git a/account_banking/data/account_banking_data.xml b/account_banking/data/account_banking_data.xml index 3d47ad718..14ae6eafe 100644 --- a/account_banking/data/account_banking_data.xml +++ b/account_banking/data/account_banking_data.xml @@ -13,12 +13,5 @@ - - - - diff --git a/base_iban_bic_not_required/__init__.py b/base_iban_bic_not_required/__init__.py new file mode 100644 index 000000000..16e8b082f --- /dev/null +++ b/base_iban_bic_not_required/__init__.py @@ -0,0 +1 @@ +import model diff --git a/base_iban_bic_not_required/__openerp__.py b/base_iban_bic_not_required/__openerp__.py new file mode 100644 index 000000000..08a6fb582 --- /dev/null +++ b/base_iban_bic_not_required/__openerp__.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2013 Therp BV (). +# 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 . +# +############################################################################## + +{ + '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 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 in 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 + ''', + 'data': [ + 'data/res_partner_bank_type_field.xml', + ], + 'installable': True, +} diff --git a/base_iban_bic_not_required/data/res_partner_bank_type_field.xml b/base_iban_bic_not_required/data/res_partner_bank_type_field.xml new file mode 100644 index 000000000..274347a4d --- /dev/null +++ b/base_iban_bic_not_required/data/res_partner_bank_type_field.xml @@ -0,0 +1,9 @@ + + + + + + + + diff --git a/base_iban_bic_not_required/model/__init__.py b/base_iban_bic_not_required/model/__init__.py new file mode 100644 index 000000000..3f2925496 --- /dev/null +++ b/base_iban_bic_not_required/model/__init__.py @@ -0,0 +1 @@ +import res_partner_bank diff --git a/base_iban_bic_not_required/model/res_partner_bank.py b/base_iban_bic_not_required/model/res_partner_bank.py new file mode 100644 index 000000000..126e628bd --- /dev/null +++ b/base_iban_bic_not_required/model/res_partner_bank.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2013 Therp BV (). +# 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 . +# +############################################################################## +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 + + # Redefine constraint to update its function reference + _constraints = [ + (_check_bank, + '\nPlease define BIC/Swift code on bank for bank ' + 'type IBAN Account to make valid payments', + ['bic']) + ]