Skip to content
Snippets Groups Projects
Commit 8ccbcb81 authored by Cédric Snauwaert's avatar Cédric Snauwaert
Browse files

[FIX]gave an error if data['currency_id'] exists but has value false

bzr revid: csn@openerp.com-20121123103657-jgewk23zrz3xo5ty
parent 2c0b28c2
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment