Merge lp:~unifield-team/unifield-addons/uf_886_hook_name_get_currency into lp:unifield-addons

Proposed by jftempo
Status: Merged
Merge reported by: jftempo
Merged at revision: not available
Proposed branch: lp:~unifield-team/unifield-addons/uf_886_hook_name_get_currency
Merge into: lp:unifield-addons
Diff against target: 24 lines (+6/-2)
1 file modified
base_setup/todo.py (+6/-2)
To merge this branch: bzr merge lp:~unifield-team/unifield-addons/uf_886_hook_name_get_currency
Reviewer Review Type Date Requested Status
UniField Dev Team Pending
Review via email: mp+98671@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'base_setup/todo.py'
--- base_setup/todo.py 2011-01-14 00:11:01 +0000
+++ base_setup/todo.py 2012-03-21 16:30:28 +0000
@@ -161,6 +161,10 @@
161class res_currency(osv.osv):161class res_currency(osv.osv):
162 _inherit = 'res.currency'162 _inherit = 'res.currency'
163163
164 def hook_get_name_currency(self, cr, uid, ids, context):
165 reads = self.read(cr, uid, ids, ['name','symbol'], context, load='_classic_write')
166 return [(x['id'], tools.ustr(x['name']) + (x['symbol'] and (' (' + tools.ustr(x['symbol']) + ')') or '')) for x in reads]
167
164 def name_get(self, cr, uid, ids, context=None):168 def name_get(self, cr, uid, ids, context=None):
165 if context is None:169 if context is None:
166 context = {}170 context = {}
@@ -170,8 +174,8 @@
170 return []174 return []
171 if isinstance(ids, (int, long)):175 if isinstance(ids, (int, long)):
172 ids = [ids]176 ids = [ids]
173 reads = self.read(cr, uid, ids, ['name','symbol'], context, load='_classic_write')177
174 return [(x['id'], tools.ustr(x['name']) + (x['symbol'] and (' (' + tools.ustr(x['symbol']) + ')') or '')) for x in reads]178 return self.hook_get_name_currency(cr, uid, ids, context)
175179
176res_currency()180res_currency()
177181

Subscribers

People subscribed via source and target branches

to all changes: