← Back to team overview

banking-addons-team team mailing list archive

[Merge] lp:~therp-nl/banking-addons/ba70-bic_not_required into lp:banking-addons/banking-addons-70

 

Stefan Rijnhart (Therp) has proposed merging lp:~therp-nl/banking-addons/ba70-bic_not_required into lp:banking-addons/banking-addons-70.

Requested reviews:
  Banking Addons Core Editors (banking-addons-team)

For more details, see:
https://code.launchpad.net/~therp-nl/banking-addons/ba70-bic_not_required/+merge/176704
-- 
https://code.launchpad.net/~therp-nl/banking-addons/ba70-bic_not_required/+merge/176704
Your team Banking Addons Core Editors is requested to review the proposed merge of lp:~therp-nl/banking-addons/ba70-bic_not_required into lp:banking-addons/banking-addons-70.
=== added directory 'base_iban_bic_not_required'
=== added file 'base_iban_bic_not_required/__init__.py'
--- base_iban_bic_not_required/__init__.py	1970-01-01 00:00:00 +0000
+++ base_iban_bic_not_required/__init__.py	2013-07-24 15:00:44 +0000
@@ -0,0 +1,1 @@
+import model

=== added file 'base_iban_bic_not_required/__openerp__.py'
--- base_iban_bic_not_required/__openerp__.py	1970-01-01 00:00:00 +0000
+++ base_iban_bic_not_required/__openerp__.py	2013-07-24 15:00:44 +0000
@@ -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,
+}

=== added directory 'base_iban_bic_not_required/model'
=== added file 'base_iban_bic_not_required/model/__init__.py'
--- base_iban_bic_not_required/model/__init__.py	1970-01-01 00:00:00 +0000
+++ base_iban_bic_not_required/model/__init__.py	2013-07-24 15:00:44 +0000
@@ -0,0 +1,1 @@
+import res_partner_bank

=== added file 'base_iban_bic_not_required/model/res_partner_bank.py'
--- base_iban_bic_not_required/model/res_partner_bank.py	1970-01-01 00:00:00 +0000
+++ base_iban_bic_not_required/model/res_partner_bank.py	2013-07-24 15:00:44 +0000
@@ -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'])
+    ]


Follow ups