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):
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:
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]))