CLIENT,KERNEL: use only context for search
bzr revid: ced-0fcfb11d78f828b799ab80bcf8c9433aa7cc6065
This commit is contained in:
parent
65557902da
commit
e59b7748e6
|
@ -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):
|
||||
|
|
|
@ -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]))
|
||||
|
|
Loading…
Reference in New Issue