Anto has proposed merging 
lp:~openerp-dev/openobject-server/trunk-bug-994272-abo into 
lp:openobject-server.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-994272-abo/+merge/131927
-- 
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-bug-994272-abo/+merge/131927
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-server/trunk-bug-994272-abo.
=== modified file 'openerp/addons/base/ir/ir_ui_menu.py'
--- openerp/addons/base/ir/ir_ui_menu.py	2012-10-13 12:09:24 +0000
+++ openerp/addons/base/ir/ir_ui_menu.py	2012-10-29 14:51:24 +0000
@@ -132,20 +132,29 @@
             return len(result)
         return result
 
-    def _get_full_name(self, cr, uid, ids, name, args, context):
+    def name_get(self, cr, uid, ids, context=None):
+        res = []
+        for id in ids:
+            elmt = self.browse(cr, uid, id, context=context)
+            res.append((id, self._get_one_full_name(elmt)))
+        return res
+
+    def _get_full_name(self, cr, uid, ids, name=None, args=None, context=None):
+        if context == None:
+            context = {}
         res = {}
-        for m in self.browse(cr, uid, ids, context=context):
-            res[m.id] = self._get_one_full_name(m)
+        for elmt in self.browse(cr, uid, ids, context=context):
+            res[elmt.id] = self._get_one_full_name(elmt)
         return res
 
-    def _get_one_full_name(self, menu, level=6):
+    def _get_one_full_name(self, elmt, level=6):
         if level<=0:
             return '...'
-        if menu.parent_id:
-            parent_path = self._get_one_full_name(menu.parent_id, level-1) + "/"
+        if elmt.parent_id:
+            parent_path = self._get_one_full_name(elmt.parent_id, level-1) + "/"
         else:
             parent_path = ''
-        return parent_path + menu.name
+        return parent_path + elmt.name
 
     def create(self, *args, **kwargs):
         self.clear_cache()
@@ -282,7 +291,7 @@
         'groups_id': fields.many2many('res.groups', 'ir_ui_menu_group_rel',
             'menu_id', 'gid', 'Groups', help="If you have groups, the visibility of this menu will be based on these groups. "\
                 "If this field is empty, OpenERP will compute visibility based on the related object's read access."),
-        'complete_name': fields.function(_get_full_name, 
+        'complete_name': fields.function(_get_full_name,
             string='Full Path', type='char', size=128),
         'icon': fields.selection(tools.icons, 'Icon', size=64),
         'icon_pict': fields.function(_get_icon_pict, type='char', size=32),

_______________________________________________
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