[FIX] base: avoid having 'False' in name of a bank

The name_get of res.partner.bank uses the format_layout to generate the name
of the bank. As every field is not required, we may get 'False' in the name.
Replace these missing values by an empty string.

Fixes #3590
This commit is contained in:
Sandy Carter 2014-11-12 13:56:41 -05:00 committed by Martin Trigaux
parent 2461baa0dd
commit 043f7b84b8
1 changed files with 1 additions and 0 deletions

View File

@ -190,6 +190,7 @@ class res_partner_bank(osv.osv):
try:
if not data.get('bank_name'):
data['bank_name'] = _('BANK')
data = dict((k, v or '') for (k, v) in data.iteritems())
name = bank_code_format[data['state']] % data
except Exception:
raise osv.except_osv(_("Formating Error"), _("Invalid Bank Account Type Name format."))