fix bugs on searching : pass limit=None, set it as default parameter on name_search method
bzr revid: hmo@tinyerp.com-20080909073454-48dwp8jhmllkzxzl
This commit is contained in:
@@ -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:
|
||||
|
||||
+2
-2
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user