From ba5f5614f334ddf169de782f12a16f5ed5e424f6 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Fri, 29 Apr 2016 11:18:49 +0200 Subject: [PATCH] [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`. --- openerp/osv/expression.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/osv/expression.py b/openerp/osv/expression.py index f90e4a82944..f29fc8f7084 100644 --- a/openerp/osv/expression.py +++ b/openerp/osv/expression.py @@ -1000,7 +1000,7 @@ class expression(object): call_null_m2m = True if right is not False: if isinstance(right, basestring): - res_ids = [x[0] for x in comodel.name_search(cr, uid, right, [], operator, context=context)] + res_ids = [x[0] for x in comodel.name_search(cr, uid, right, [], operator, context=context, limit=None)] if res_ids: operator = 'in' else: