diff --git a/bin/addons/base/ir/ir_ui_menu.py b/bin/addons/base/ir/ir_ui_menu.py index 8aa96e2fa5e..675b97e58f9 100644 --- a/bin/addons/base/ir/ir_ui_menu.py +++ b/bin/addons/base/ir/ir_ui_menu.py @@ -68,8 +68,8 @@ icons = map(lambda x: (x,x), ['STOCK_ABOUT', 'STOCK_ADD', 'STOCK_APPLY', 'STOCK_ class ir_ui_menu(osv.osv): _name = 'ir.ui.menu' - def search(self, cr, uid, args, offset=0, limit=2000, order=None): - ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order) + def search(self, cr, uid, args, offset=0, limit=2000, order=None, context={}): + ids = osv.orm.orm.search(self, cr, uid, args, offset, limit, order, context=context) user_groups = self.pool.get('res.users').read(cr, uid, [uid])[0]['groups_id'] result = [] for menu in self.browse(cr, uid, ids): diff --git a/bin/osv/orm.py b/bin/osv/orm.py index acb2bd092fc..17970f72492 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1362,7 +1362,7 @@ class orm(object): qu1.append(' (1=0)') return (qu1,qu2) - def search(self, cr, user, args, offset=0, limit=None, order=None, context={}, translate=False): + def search(self, cr, user, args, offset=0, limit=None, order=None, context={}): # if the object has a field named 'active', filter out all inactive # records unless they were explicitely asked for if 'active' in self._columns: @@ -1472,7 +1472,7 @@ class orm(object): if field._fnct_search: args.extend(field.search(cr, user, self, arg[0][0], arg)) else: - if field.translate and translate and context.get('lang', False) and context['lang'] != 'en_EN': + if field.translate and context.get('lang', False) and context['lang'] != 'en_EN': if args[i][1] in ('like', 'ilike'): args[i][2] = '%%%s%%' % args[i][2] cr.execute('select res_id from ir_translation where name = %s and lang = %s and type = %s and value '+args[i][1]+' %s', (table._name+','+args[i][0], context['lang'], 'model', args[i][2]))