Merge lp:~openerp-dev/openobject-addons/6.1-opw-574522-skh into lp:openobject-addons/6.1

Proposed by Somesh Khare
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-574522-skh
Merge into: lp:openobject-addons/6.1
Diff against target: 24 lines (+4/-2)
1 file modified
base_iban/base_iban.py (+4/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-574522-skh
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+104881@code.launchpad.net

Description of the change

Hello Sir,

[Fix] : base_iban module: invalid literal Error when trying to save the Bank Accounts details without Account Number and BIC code (Case: Ref 574522).

Steps to reproduce:
--> Installed module base_iban and l10n_fr_rib
--> Open menu Sales/Configuration/Address Book/Bank Accounts
--> Select "Bank Account Type" = IBAN Account
--> And fill other necessary info and try to "SAVE"
--> Error Occurred as: ValueError: invalid literal for int() with base 10: ''

This branch fixes this issue.

Kindly review the branch and please share your views on it.

Thanks,
Somesh Khare

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello,

This bug was qualified as Confirmed on Trunk (means still existing and reproducible). A Merge Proposal for trunk was created to fix it. Here is the link to follow the MP on Launchpad https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-opw-574522-port-mma/+merge/132647 and be informed once it's been merged in trunk: ... If this Merge Proposal could not be merged in v6.1 at the release of v7.0, it will be closed.

Thanks,
Naresh Soni

Unmerged revisions

6789. By Somesh Khare

[FIX]base_iban: invalid literal Error when trying to save the Bank Accounts details without Account Number and BIC code (Case: Ref 574522)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_iban/base_iban.py'
2--- base_iban/base_iban.py 2012-02-01 11:05:07 +0000
3+++ base_iban/base_iban.py 2012-05-07 09:46:18 +0000
4@@ -99,6 +99,8 @@
5 @param iban: IBAN as string
6 @return: True if IBAN is valid, False otherwise
7 """
8+ if not iban:
9+ return False
10 iban = _format_iban(iban).lower()
11 if iban[:2] in _ref_iban and len(iban) != len(_format_iban(_ref_iban[iban[:2]])):
12 return False
13@@ -128,9 +130,9 @@
14 def _construct_constraint_msg(self, cr, uid, ids, context=None):
15
16 def default_iban_check(iban_cn):
17- return iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase
18+ return iban_cn and iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase
19
20- iban_country = self.browse(cr, uid, ids)[0].acc_number[:2].lower()
21+ iban_country = self.browse(cr, uid, ids)[0].acc_number and self.browse(cr, uid, ids)[0].acc_number[:2].lower()
22 if default_iban_check(iban_country):
23 if iban_country in _ref_iban:
24 return _('The IBAN does not seem to be correct. You should have entered something like this %s'), \