[FIX] Check if the iban key is present and has a value in the dictionary

lp bug: https://launchpad.net/bugs/323238 fixed

bzr revid: stephane@tinyerp.com-20090203105003-4ix3ct06qj93xeux
This commit is contained in:
Stephane Wirtel 2009-02-03 11:50:03 +01:00
parent 2a18349ad6
commit d75143727d
1 changed files with 2 additions and 2 deletions

View File

@ -38,13 +38,13 @@ class res_partner_bank(osv.osv):
def create(self, cr, uid, vals, context={}):
#overwrite to format the iban number correctly
if vals.has_key('iban'):
if 'iban' in vals and vals['iban']:
vals['iban'] = _format_iban(vals['iban'])
return super(res_partner_bank, self).create(cr, uid, vals, context)
def write(self, cr, uid, ids, vals, context={}):
#overwrite to format the iban number correctly
if vals.has_key('iban'):
if 'iban' in vals and vals['iban']:
vals['iban'] = _format_iban(vals['iban'])
return super(res_partner_bank, self).write(cr, uid, ids, vals, context)