[ADD] Module base_iban_bic_not_required

This commit is contained in:
Stefan Rijnhart
2013-08-12 09:08:19 +02:00
committed by Guewen Baconnier
6 changed files with 96 additions and 7 deletions

View File

@@ -13,12 +13,5 @@
<field eval="False" name="required"/>
<field eval="False" name="readonly"/>
</record>
<!--
BIC is not legally required
See https://bugs.launchpad.net/bugs/933472
-->
<record id="base_iban.bank_swift_field" model="res.partner.bank.type.field">
<field eval="False" name="required"/>
</record>
</data>
</openerp>

View File

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

View File

@@ -0,0 +1,47 @@
# -*- 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 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,
}

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="base_iban.bank_swift_field"
model="res.partner.bank.type.field">
<field eval="False" name="required"/>
</record>
</data>
</openerp>

View File

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

View File

@@ -0,0 +1,38 @@
# -*- 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
# 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'])
]