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
=== modified file 'account_banking/data/account_banking_data.xml'
--- account_banking/data/account_banking_data.xml 2013-03-16 16:44:19 +0000
+++ account_banking/data/account_banking_data.xml 2013-07-28 19:52:26 +0000
@@ -13,12 +13,5 @@
13 <field eval="False" name="required"/>13 <field eval="False" name="required"/>
14 <field eval="False" name="readonly"/>14 <field eval="False" name="readonly"/>
15 </record>15 </record>
16 <!--
17 BIC is not legally required
18 See https://bugs.launchpad.net/bugs/933472
19 -->
20 <record id="base_iban.bank_swift_field" model="res.partner.bank.type.field">
21 <field eval="False" name="required"/>
22 </record>
23 </data>16 </data>
24</openerp>17</openerp>
2518
=== 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-28 19:52:26 +0000
@@ -0,0 +1,1 @@
1import model
02
=== 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-28 19:52:26 +0000
@@ -0,0 +1,47 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2013 Therp BV (<http://therp.nl>).
5# All Rights Reserved
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22{
23 'name': 'IBAN - Bic not required',
24 'version': '0.1',
25 'license': 'AGPL-3',
26 'author': 'Banking addons community',
27 'website': 'https://launchpad.net/banking-addons',
28 'category': 'Banking addons',
29 'depends': [
30 'base_iban',
31 ],
32 'description': '''
33The account_iban module in OpenERP mandates the presence of a BIC
34code on an IBAN account number through a constraint. However, as of
35Februari 2012 there is a resolution from the EU that drops this requirement
36(see section 8 of [1]). This module reverts the constraint on BICs in the
37base_iban module.
38
39See also https://bugs.launchpad.net/openobject-addons/+bug/933472
40
41[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
42 ''',
43 'data': [
44 'data/res_partner_bank_type_field.xml',
45 ],
46 'installable': True,
47}
048
=== added directory 'base_iban_bic_not_required/data'
=== added file 'base_iban_bic_not_required/data/res_partner_bank_type_field.xml'
--- base_iban_bic_not_required/data/res_partner_bank_type_field.xml 1970-01-01 00:00:00 +0000
+++ base_iban_bic_not_required/data/res_partner_bank_type_field.xml 2013-07-28 19:52:26 +0000
@@ -0,0 +1,9 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="base_iban.bank_swift_field"
5 model="res.partner.bank.type.field">
6 <field eval="False" name="required"/>
7 </record>
8 </data>
9</openerp>
010
=== 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-28 19:52:26 +0000
@@ -0,0 +1,1 @@
1import res_partner_bank
02
=== 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-28 19:52:26 +0000
@@ -0,0 +1,38 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2013 Therp BV (<http://therp.nl>).
5# All Rights Reserved
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21from openerp.osv import orm
22
23
24class res_partner_bank(orm.Model):
25 _inherit = 'res.partner.bank'
26
27 def _check_bank(self, cr, uid, ids, context=None):
28 #suppress base_iban's constraint to enforce BICs for IBANs
29 #workaround for lp:933472
30 return True
31
32 # Redefine constraint to update its function reference
33 _constraints = [
34 (_check_bank,
35 '\nPlease define BIC/Swift code on bank for bank '
36 'type IBAN Account to make valid payments',
37 ['bic'])
38 ]

Subscribers

People subscribed via source and target branches

to status/vote changes: