class res_partner_bank(osv.osv):
_inherit = "res.partner.bank"
- def create(self, cr, uid, vals, context={}):
+ def create(self, cr, uid, vals, context=None):
#overwrite to format the iban number correctly
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={}):
+ def write(self, cr, uid, ids, vals, context=None):
#overwrite to format the iban number correctly
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)
- def check_iban(self, cr, uid, ids):
+ def check_iban(self, cr, uid, ids, context=None):
'''
Check the IBAN number
'''
- for bank_acc in self.browse(cr, uid, ids):
+ for bank_acc in self.browse(cr, uid, ids, context=context):
if not bank_acc.iban:
continue
iban = _format_iban(bank_acc.iban)
return False
return True
- def _construct_constraint_msg(self, cr, uid, ids):
+ def _construct_constraint_msg(self, cr, uid, ids, context=None):
def default_iban_check(iban_cn):
return iban_cn[0] in string.ascii_lowercase and iban_cn[1] in string.ascii_lowercase
def name_get(self, cr, uid, ids, context=None):
res = []
to_check_ids = []
- for id in self.browse(cr, uid, ids):
+ for id in self.browse(cr, uid, ids, context=context):
if id.state=='iban':
res.append((id.id,id.iban))
else:
to_check_ids.append(id.id)
- res += super(res_partner_bank, self).name_get(cr, uid, to_check_ids, context)
+ res += super(res_partner_bank, self).name_get(cr, uid, to_check_ids, context=context)
return res
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
'ch': lambda x: x[9:],
'gb': lambda x: x[14:],
}
- for record in self.browse(cr, uid, ids, context):
+ for record in self.browse(cr, uid, ids, context=context):
if not record.iban:
res[record.id] = False
continue