mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[ADD] Module base_iban_bic_not_required
This commit is contained in:
@@ -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>
|
||||
|
||||
1
base_iban_bic_not_required/__init__.py
Normal file
1
base_iban_bic_not_required/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
import model
|
||||
47
base_iban_bic_not_required/__openerp__.py
Normal file
47
base_iban_bic_not_required/__openerp__.py
Normal 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,
|
||||
}
|
||||
@@ -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>
|
||||
1
base_iban_bic_not_required/model/__init__.py
Normal file
1
base_iban_bic_not_required/model/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
import res_partner_bank
|
||||
38
base_iban_bic_not_required/model/res_partner_bank.py
Normal file
38
base_iban_bic_not_required/model/res_partner_bank.py
Normal 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'])
|
||||
]
|
||||
Reference in New Issue
Block a user