Rucha (Open ERP) has proposed merging 
lp:~openerp-dev/openobject-server/trunk-configuration-rework-refactoring-rpa 
into lp:~openerp-dev/openobject-server/trunk-configuration-rework.

Requested reviews:
  qdp (OpenERP) (qdp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-configuration-rework-refactoring-rpa/+merge/66100

Moved name_get of currency from base_setup into main currency class
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-configuration-rework-refactoring-rpa/+merge/66100
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/trunk-configuration-rework.
=== modified file 'openerp/addons/base/res/res_currency.py'
--- openerp/addons/base/res/res_currency.py	2011-04-19 13:11:54 +0000
+++ openerp/addons/base/res/res_currency.py	2011-06-28 10:10:06 +0000
@@ -78,6 +78,18 @@
                     r['date'] = currency_date
         return res
 
+    def name_get(self, cr, uid, ids, context=None):
+        if context is None:
+            context = {}
+#        We can use the following line,if we want to restrict this name_get for company setup only
+#        But, its better to show currencies as name(Code).
+        if not len(ids):
+            return []
+        if isinstance(ids, (int, long)):
+            ids = [ids]
+        reads = self.read(cr, uid, ids, ['name','symbol'], context, load='_classic_write')
+        return [(x['id'], tools.ustr(x['name']) + (x['symbol'] and (' (' + tools.ustr(x['symbol']) + ')') or '')) for x in reads]
+
     def round(self, cr, uid, currency, amount):
         if currency.rounding == 0:
             return 0.0

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to