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

Proposed by Stefan Rijnhart (Opener)
Status: Merged
Merged at revision: 179
Proposed branch: lp:~therp-nl/banking-addons/ba70-bic_not_required
Merge into: lp:banking-addons
Diff against target: 140 lines (+96/-7)
6 files modified
account_banking/data/account_banking_data.xml (+0/-7)
base_iban_bic_not_required/__init__.py (+1/-0)
base_iban_bic_not_required/__openerp__.py (+47/-0)
base_iban_bic_not_required/data/res_partner_bank_type_field.xml (+9/-0)
base_iban_bic_not_required/model/__init__.py (+1/-0)
base_iban_bic_not_required/model/res_partner_bank.py (+38/-0)
To merge this branch: bzr merge lp:~therp-nl/banking-addons/ba70-bic_not_required
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp code review, no test Approve
Holger Brunn (Therp) code review Approve
Stéphane Bidoul (Acsone) (community) code review and test Approve
Review via email: mp+176704@code.launchpad.net
To post a comment you must log in.
177. By Stefan Rijnhart (Opener)

[FIX] OpenERP version

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) wrote :

Hi Stefan,

I noticed base_iban makes the bank_bic field required in addition to the in-code constraint (see base_iban/base_iban_data.xml)

        <record id="bank_swift_field" model="res.partner.bank.type.field">
            <field name="name">bank_bic</field>
            <field name="bank_type_id" ref="bank_iban"/>
            <field eval="True" name="required"/>
            <field eval="False" name="readonly"/>
        </record>

I believe this should be reverted by your module too, otherwise the bank account creation wizard still requires the BIC.

review: Needs Information (code review and test)
178. By Stefan Rijnhart (Opener)

[RFR] Move remnant of earlier implementation to dedicated module

179. By Stefan Rijnhart (Opener)

[FIX] Remove copy/paste comment

180. By Stefan Rijnhart (Opener)

[IMP] Inline documentation, line length

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks for noticing this. This code was already present in a preliminary implementation in the account_banking module itself. I moved it to the new module, as it does not depend on account_banking.

Revision history for this message
Stéphane Bidoul (Acsone) (sbi) :
review: Approve (code review and test)
Revision history for this message
Holger Brunn (Therp) (hbrunn) :
review: Approve (code review)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM

review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_banking/data/account_banking_data.xml'
2--- account_banking/data/account_banking_data.xml 2013-03-16 16:44:19 +0000
3+++ account_banking/data/account_banking_data.xml 2013-07-28 19:52:26 +0000
4@@ -13,12 +13,5 @@
5 <field eval="False" name="required"/>
6 <field eval="False" name="readonly"/>
7 </record>
8- <!--
9- BIC is not legally required
10- See https://bugs.launchpad.net/bugs/933472
11- -->
12- <record id="base_iban.bank_swift_field" model="res.partner.bank.type.field">
13- <field eval="False" name="required"/>
14- </record>
15 </data>
16 </openerp>
17
18=== added directory 'base_iban_bic_not_required'
19=== added file 'base_iban_bic_not_required/__init__.py'
20--- base_iban_bic_not_required/__init__.py 1970-01-01 00:00:00 +0000
21+++ base_iban_bic_not_required/__init__.py 2013-07-28 19:52:26 +0000
22@@ -0,0 +1,1 @@
23+import model
24
25=== added file 'base_iban_bic_not_required/__openerp__.py'
26--- base_iban_bic_not_required/__openerp__.py 1970-01-01 00:00:00 +0000
27+++ base_iban_bic_not_required/__openerp__.py 2013-07-28 19:52:26 +0000
28@@ -0,0 +1,47 @@
29+# -*- coding: utf-8 -*-
30+##############################################################################
31+#
32+# Copyright (C) 2013 Therp BV (<http://therp.nl>).
33+# All Rights Reserved
34+#
35+# This program is free software: you can redistribute it and/or modify
36+# it under the terms of the GNU Affero General Public License as
37+# published by the Free Software Foundation, either version 3 of the
38+# License, or (at your option) any later version.
39+#
40+# This program is distributed in the hope that it will be useful,
41+# but WITHOUT ANY WARRANTY; without even the implied warranty of
42+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
43+# GNU Affero General Public License for more details.
44+#
45+# You should have received a copy of the GNU Affero General Public License
46+# along with this program. If not, see <http://www.gnu.org/licenses/>.
47+#
48+##############################################################################
49+
50+{
51+ 'name': 'IBAN - Bic not required',
52+ 'version': '0.1',
53+ 'license': 'AGPL-3',
54+ 'author': 'Banking addons community',
55+ 'website': 'https://launchpad.net/banking-addons',
56+ 'category': 'Banking addons',
57+ 'depends': [
58+ 'base_iban',
59+ ],
60+ 'description': '''
61+The account_iban module in OpenERP mandates the presence of a BIC
62+code on an IBAN account number through a constraint. However, as of
63+Februari 2012 there is a resolution from the EU that drops this requirement
64+(see section 8 of [1]). This module reverts the constraint on BICs in the
65+base_iban module.
66+
67+See also https://bugs.launchpad.net/openobject-addons/+bug/933472
68+
69+[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
70+ ''',
71+ 'data': [
72+ 'data/res_partner_bank_type_field.xml',
73+ ],
74+ 'installable': True,
75+}
76
77=== added directory 'base_iban_bic_not_required/data'
78=== added file 'base_iban_bic_not_required/data/res_partner_bank_type_field.xml'
79--- base_iban_bic_not_required/data/res_partner_bank_type_field.xml 1970-01-01 00:00:00 +0000
80+++ base_iban_bic_not_required/data/res_partner_bank_type_field.xml 2013-07-28 19:52:26 +0000
81@@ -0,0 +1,9 @@
82+<?xml version="1.0" encoding="utf-8"?>
83+<openerp>
84+ <data>
85+ <record id="base_iban.bank_swift_field"
86+ model="res.partner.bank.type.field">
87+ <field eval="False" name="required"/>
88+ </record>
89+ </data>
90+</openerp>
91
92=== added directory 'base_iban_bic_not_required/model'
93=== added file 'base_iban_bic_not_required/model/__init__.py'
94--- base_iban_bic_not_required/model/__init__.py 1970-01-01 00:00:00 +0000
95+++ base_iban_bic_not_required/model/__init__.py 2013-07-28 19:52:26 +0000
96@@ -0,0 +1,1 @@
97+import res_partner_bank
98
99=== added file 'base_iban_bic_not_required/model/res_partner_bank.py'
100--- base_iban_bic_not_required/model/res_partner_bank.py 1970-01-01 00:00:00 +0000
101+++ base_iban_bic_not_required/model/res_partner_bank.py 2013-07-28 19:52:26 +0000
102@@ -0,0 +1,38 @@
103+# -*- coding: utf-8 -*-
104+##############################################################################
105+#
106+# Copyright (C) 2013 Therp BV (<http://therp.nl>).
107+# All Rights Reserved
108+#
109+# This program is free software: you can redistribute it and/or modify
110+# it under the terms of the GNU Affero General Public License as
111+# published by the Free Software Foundation, either version 3 of the
112+# License, or (at your option) any later version.
113+#
114+# This program is distributed in the hope that it will be useful,
115+# but WITHOUT ANY WARRANTY; without even the implied warranty of
116+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
117+# GNU Affero General Public License for more details.
118+#
119+# You should have received a copy of the GNU Affero General Public License
120+# along with this program. If not, see <http://www.gnu.org/licenses/>.
121+#
122+##############################################################################
123+from openerp.osv import orm
124+
125+
126+class res_partner_bank(orm.Model):
127+ _inherit = 'res.partner.bank'
128+
129+ def _check_bank(self, cr, uid, ids, context=None):
130+ #suppress base_iban's constraint to enforce BICs for IBANs
131+ #workaround for lp:933472
132+ return True
133+
134+ # Redefine constraint to update its function reference
135+ _constraints = [
136+ (_check_bank,
137+ '\nPlease define BIC/Swift code on bank for bank '
138+ 'type IBAN Account to make valid payments',
139+ ['bic'])
140+ ]

Subscribers

People subscribed via source and target branches

to status/vote changes: