[FIX]gave an error if data['currency_id'] exists but has value false
bzr revid: csn@openerp.com-20121123103657-jgewk23zrz3xo5ty
This commit is contained in:
parent
2c0b28c27a
commit
8ccbcb8171
|
@ -45,7 +45,7 @@ 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 'currency_id' in data))
|
||||
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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue