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
=== modified file 'base_iban/base_iban.py'
--- base_iban/base_iban.py 2012-02-01 11:05:07 +0000
+++ base_iban/base_iban.py 2012-05-07 09:46:18 +0000
@@ -99,6 +99,8 @@
99 @param iban: IBAN as string99 @param iban: IBAN as string
100 @return: True if IBAN is valid, False otherwise100 @return: True if IBAN is valid, False otherwise
101 """101 """
102 if not iban:
103 return False
102 iban = _format_iban(iban).lower()104 iban = _format_iban(iban).lower()
103 if iban[:2] in _ref_iban and len(iban) != len(_format_iban(_ref_iban[iban[:2]])):105 if iban[:2] in _ref_iban and len(iban) != len(_format_iban(_ref_iban[iban[:2]])):
104 return False106 return False
@@ -128,9 +130,9 @@
128 def _construct_constraint_msg(self, cr, uid, ids, context=None):130 def _construct_constraint_msg(self, cr, uid, ids, context=None):
129131
130 def default_iban_check(iban_cn):132 def default_iban_check(iban_cn):
131 return iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase133 return iban_cn and iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase
132134
133 iban_country = self.browse(cr, uid, ids)[0].acc_number[:2].lower()135 iban_country = self.browse(cr, uid, ids)[0].acc_number and self.browse(cr, uid, ids)[0].acc_number[:2].lower()
134 if default_iban_check(iban_country):136 if default_iban_check(iban_country):
135 if iban_country in _ref_iban:137 if iban_country in _ref_iban:
136 return _('The IBAN does not seem to be correct. You should have entered something like this %s'), \138 return _('The IBAN does not seem to be correct. You should have entered something like this %s'), \