[FIX]traceback when trying to add bank account to company
lp bug: https://launchpad.net/bugs/1081491 fixed bzr revid: csn@openerp.com-20121123111232-6iwlr4i407ry02ys
This commit is contained in:
@@ -45,12 +45,12 @@ class bank(osv.osv):
|
||||
|
||||
def _prepare_name_get(self, cr, uid, bank_dicts, context=None):
|
||||
"""Add ability to have %(currency_name)s in the format_layout of res.partner.bank.type"""
|
||||
currency_ids = list(set(data['currency_id'][0] for data in bank_dicts if data['currency_id']))
|
||||
currency_ids = list(set(data['currency_id'][0] for data in bank_dicts if data.get('currency_id')))
|
||||
currencies = self.pool.get('res.currency').browse(cr, uid, currency_ids, context=context)
|
||||
currency_name = dict((currency.id, currency.name) for currency in currencies)
|
||||
|
||||
for data in bank_dicts:
|
||||
data['currency_name'] = data['currency_id'] and currency_name[data['currency_id'][0]] or ''
|
||||
data['currency_name'] = data.get('currency_id') and currency_name[data['currency_id'][0]] or ''
|
||||
return super(bank, self)._prepare_name_get(cr, uid, bank_dicts, context=context)
|
||||
|
||||
def post_write(self, cr, uid, ids, context=None):
|
||||
|
||||
Reference in New Issue
Block a user