projects
/
odoo
/
odoo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4d2255a
)
Allows inheritance of the name_get function of res.partner.bank
author
Alexis de Lattre
<alexis@via.ecp.fr>
Tue, 10 Jul 2012 23:50:09 +0000
(
01:50
+0200)
committer
Alexis de Lattre
<alexis@via.ecp.fr>
Tue, 10 Jul 2012 23:50:09 +0000
(
01:50
+0200)
bzr revid: alexis@via.ecp.fr-
20120710235009
-msv7aiaa3gfhznmq
openerp/addons/base/res/res_bank.py
patch
|
blob
|
history
diff --git
a/openerp/addons/base/res/res_bank.py
b/openerp/addons/base/res/res_bank.py
index
c9010b6
..
c5c05c1
100644
(file)
--- a/
openerp/addons/base/res/res_bank.py
+++ b/
openerp/addons/base/res/res_bank.py
@@
-172,6
+172,17
@@
class res_partner_bank(osv.osv):
('required', field.required)]
return res
('required', field.required)]
return res
+ def _prepare_name_get(self, cr, uid, bank_type_obj, bank_obj, context=None):
+ """
+ Format the name of a res.partner.bank.
+ This function is designed to be inherited to add replacement fields.
+ :param browse_record bank_type_obj: res.partner.bank.type object
+ :param browse_record bank_obj: res.partner.bank object
+ :rtype: str
+ :return: formatted name of a res.partner.bank record
+ """
+ return bank_type_obj.format_layout % bank_obj._data[bank_obj.id]
+
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
@@
-187,7
+198,7
@@
class res_partner_bank(osv.osv):
# avoid the default format_layout to result in "False: ..."
if not val._data[val.id]['bank_name']:
val._data[val.id]['bank_name'] = _('BANK')
# 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 = self._prepare_name_get(cr, uid, t, val, context=context)
except:
result += ' [Formatting Error]'
raise
except:
result += ' [Formatting Error]'
raise