Skip to content

Commit

Permalink
[MERGE] merge bug fix
Browse files Browse the repository at this point in the history
- original commit message:
  [FIX] ir_ui_view.py: get_sc only returns shortcuts for existing menu items.

lp bug: https://launchpad.net/bugs/727730 fixed

bzr revid: [email protected]
  • Loading branch information
Vo Minh Thu committed Apr 6, 2011
2 parents 7f7e771 + b1ffebe commit 86bc2a6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/addons/base/ir/ir_ui_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ def get_sc(self, cr, uid, user_id, model='ir.ui.menu', context=None):
ids = self.search(cr, uid, [('user_id','=',user_id),('resource','=',model)], context=context)
results = self.read(cr, uid, ids, ['res_id'], context=context)
name_map = dict(self.pool.get(model).name_get(cr, uid, [x['res_id'] for x in results], context=context))
for result in results:
# Make sure to return only shortcuts pointing to exisintg menu items.
filtered_results = filter(lambda result: result['res_id'] in name_map, results)
for result in filtered_results:
result.update(name=name_map[result['res_id']])
return results
return filtered_results

_order = 'sequence,name'
_defaults = {
Expand Down

0 comments on commit 86bc2a6

Please sign in to comment.