diff --git a/bin/osv/expression.py b/bin/osv/expression.py index 8c67ceb48d4..44658f33b96 100644 --- a/bin/osv/expression.py +++ b/bin/osv/expression.py @@ -126,7 +126,7 @@ class expression(object): elif field._type == 'one2many': if isinstance(right, basestring): - ids2 = [x[0] for x in field_obj.name_search(cr, uid, right, [], operator)] + ids2 = [x[0] for x in field_obj.name_search(cr, uid, right, [], operator,limit=None)] else: ids2 = list(right) if not ids2: @@ -138,7 +138,7 @@ class expression(object): #FIXME if operator == 'child_of': if isinstance(right, basestring): - ids2 = [x[0] for x in field_obj.name_search(cr, uid, right, [], 'like')] + ids2 = [x[0] for x in field_obj.name_search(cr, uid, right, [], 'like',limit=None)] else: ids2 = list(right) @@ -159,7 +159,7 @@ class expression(object): elif field._type == 'many2one': if operator == 'child_of': if isinstance(right, basestring): - ids2 = [x[0] for x in field_obj.search_name(cr, uid, right, [], 'like')] + ids2 = [x[0] for x in field_obj.name_search(cr, uid, right, [], 'like',limit=None)] else: ids2 = list(right) @@ -171,7 +171,7 @@ class expression(object): self.__exp = self.__exp[:i] + dom + self.__exp[i+1:] else: if isinstance(right, basestring): - res_ids = field_obj.name_search(cr, uid, right, [], operator) + res_ids = field_obj.name_search(cr, uid, right, [], operator,limit=None) right = map(lambda x: x[0], res_ids) self.__exp[i] = (left, 'in', right) else: diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 5d73ee402f3..2a4287106a0 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1075,7 +1075,7 @@ class orm_template(object): def name_get(self, cr, user, ids, context=None): raise _('The name_get method is not implemented on this object !') - def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=None): raise _('The name_search method is not implemented on this object !') def copy(self, cr, uid, id, default=None, context=None): @@ -2397,7 +2397,7 @@ class orm(orm_template): return [(r['id'], str(r[self._rec_name])) for r in self.read(cr, user, ids, [self._rec_name], context, load='_classic_write')] - def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=80): + def name_search(self, cr, user, name='', args=None, operator='ilike', context=None, limit=None): if not args: args = [] if not context: