[MERGE] fix limit=None name_search on products
bzr revid: fp@tinyerp.com-20121113080350-j3n5bc9rw4ocabs1
This commit is contained in:
commit
e4b64624e4
|
@ -657,9 +657,9 @@ class product_product(osv.osv):
|
|||
# Performing a quick memory merge of ids in Python will give much better performance
|
||||
ids = set()
|
||||
ids.update(self.search(cr, user, args + [('default_code',operator,name)], limit=limit, context=context))
|
||||
if len(ids) < limit:
|
||||
if not limit or len(ids) < limit:
|
||||
# we may underrun the limit because of dupes in the results, that's fine
|
||||
ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit-len(ids)), context=context))
|
||||
ids.update(self.search(cr, user, args + [('name',operator,name)], limit=(limit and (limit-len(ids)) or False) , context=context))
|
||||
ids = list(ids)
|
||||
if not ids:
|
||||
ptrn = re.compile('(\[(.*?)\])')
|
||||
|
|
Loading…
Reference in New Issue