diff options
| author | Christophe Simonis <chs@tinyerp.com> | 2010-01-20 17:52:08 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@tinyerp.com> | 2010-01-20 17:52:08 +0100 |
| commit | db13ceee7aa2221b49dc8645871e12986ebe822f (patch) | |
| tree | 3df9c8f14af537669629762ab7725bd32a15e409 /bin/addons/base/ir/ir_ui_menu.py | |
| parent | fecc3a360da24cd76b366626b4ef577bd7b032ab (diff) | |
[FIX] revert previous patch about linked bug (lp:497364)
lp bug: https://launchpad.net/bugs/497364 fixed
bzr revid: chs@tinyerp.com-20100120165208-ppmd7tq9mqm1jtcu
Diffstat (limited to 'bin/addons/base/ir/ir_ui_menu.py')
| -rw-r--r-- | bin/addons/base/ir/ir_ui_menu.py | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/bin/addons/base/ir/ir_ui_menu.py b/bin/addons/base/ir/ir_ui_menu.py index 98654c9d4e8..75a3550250e 100644 --- a/bin/addons/base/ir/ir_ui_menu.py +++ b/bin/addons/base/ir/ir_ui_menu.py @@ -53,7 +53,6 @@ class ir_ui_menu(osv.osv): def __init__(self, *args, **kwargs): self._cache = {} - self._parents = [] r = super(ir_ui_menu, self).__init__(*args, **kwargs) self.pool.get('ir.model.access').register_cache_clearing_method(self._name, 'clear_cache') return r @@ -65,35 +64,20 @@ class ir_ui_menu(osv.osv): def clear_cache(self): # radical but this doesn't frequently happen self._cache = {} - self._parents = [] def search(self, cr, uid, args, offset=0, limit=2000, order=None, context=None, count=False): if context is None: context = {} - - if uid !=1: - flag = True - for dom in args: - if dom[0] == 'parent_id': - flag = False - break - #Args should add the following domain in order to maintain the integrity of search. - #i.e. if search is performed on list view. - if flag: - args += [('parent_id','child_of',self._parents)] - - ids = osv.orm.orm.search(self, cr, uid, args, offset, uid==1 and limit or None, order, context=context, count=(count and uid==1)) + ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context, count=(count and uid==1)) if uid==1: - if limit and not count: - ids = ids[:int(limit)] return ids if not ids: if count: return 0 return [] - + modelaccess = self.pool.get('ir.model.access') user_groups = set(self.pool.get('res.users').read(cr, 1, uid, ['groups_id'])['groups_id']) result = [] @@ -103,7 +87,7 @@ class ir_ui_menu(osv.osv): if key in self._cache: if self._cache[key]: result.append(menu.id) - continue + continue self._cache[key] = False if menu.groups_id: @@ -112,8 +96,6 @@ class ir_ui_menu(osv.osv): continue result.append(menu.id) self._cache[key] = True - if not menu.parent_id.id: - self._parents.append(menu.id) continue if menu.action: @@ -138,20 +120,12 @@ class ir_ui_menu(osv.osv): if not menu.child_id: # not displayed if there is no children continue - - if not menu.parent_id.id: -# #For List view display,this list keeps the track of parents - self._parents.append(menu.id) result.append(menu.id) - self._cache[key] = True + self._cache[key] = True if count: return len(result) - - if limit: - result = result[:int(limit)] - return result def _get_full_name(self, cr, uid, ids, name, args, context): |
