[MERGE] ability to add the currency information on name get of res.partner.bank object. Courtesy of Alexis de Lattre, Akretion

bzr revid: qdp-launchpad@openerp.com-20120711083311-u79056d3l5f8mz5v
This commit is contained in:
Quentin (OpenERP) 2012-07-11 10:33:11 +02:00
commit eaa05c4133
1 changed files with 6 additions and 0 deletions

View File

@ -43,6 +43,12 @@ class bank(osv.osv):
"Return the name to use when creating a bank journal"
return (bank.bank_name or '') + ' ' + bank.acc_number
def _prepare_name_get(self, cr, uid, bank_type_obj, bank_obj, context=None):
"""Add ability to have %(currency_name)s in the format_layout of
res.partner.bank.type"""
bank_obj._data[bank_obj.id]['currency_name'] = bank_obj.currency_id and bank_obj.currency_id.name or ''
return super(bank, self)._prepare_name_get(cr, uid, bank_type_obj, bank_obj, context=context)
def post_write(self, cr, uid, ids, context={}):
if isinstance(ids, (int, long)):
ids = [ids]