[FIX] expression: fix missing results in direct search on many2many fields

This case corresponds to searches like `[(field, 'ilike', name)]` where `field`
is a many2many field.  The domain processing performs a `name_search` on the
field's comodel, then makes the relation match the returned record ids.

Problem: the call to `name_search` uses the default limit (100), and this makes
the search return less results than expected.  Make the search complete by
forcing `limit=None`.
This commit is contained in:
Raphael Collet 2016-04-29 15:45:21 +02:00
parent e1a17b433d
commit c7baab6789
1 changed files with 1 additions and 1 deletions

View File

@ -956,7 +956,7 @@ class expression(object):
call_null_m2m = True
if right is not False:
if isinstance(right, basestring):
res_ids = [x[0] for x in relational_model.name_search(cr, uid, right, [], operator, context=context)]
res_ids = [x[0] for x in relational_model.name_search(cr, uid, right, [], operator, context=context, limit=None)]
if res_ids:
operator = 'in'
else: