[MERGE] lp:918120 (res.partner.bank: improve name_get() when no bank_name is given)
bzr revid: rco@openerp.com-20120127085133-hwzn9up9gp12cwgi
This commit is contained in:
commit
6c6e5d291c
|
@ -20,6 +20,7 @@
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
|
from tools.translate import _
|
||||||
|
|
||||||
class Bank(osv.osv):
|
class Bank(osv.osv):
|
||||||
_description='Bank'
|
_description='Bank'
|
||||||
|
@ -183,6 +184,9 @@ class res_partner_bank(osv.osv):
|
||||||
if type_ids:
|
if type_ids:
|
||||||
t = bank_type_obj.browse(cr, uid, type_ids[0], context=context)
|
t = bank_type_obj.browse(cr, uid, type_ids[0], context=context)
|
||||||
try:
|
try:
|
||||||
|
# avoid the default format_layout to result in "False: ..."
|
||||||
|
if not val._data[val.id]['bank_name']:
|
||||||
|
val._data[val.id]['bank_name'] = _('BANK')
|
||||||
result = t.format_layout % val._data[val.id]
|
result = t.format_layout % val._data[val.id]
|
||||||
except:
|
except:
|
||||||
result += ' [Formating Error]'
|
result += ' [Formating Error]'
|
||||||
|
|
Loading…
Reference in New Issue