[FIX]product: when you search the product the limit into the name_search() goes None
bzr revid: mma@tinyerp.com-20121102084004-af7m8wlov3w627ei
This commit is contained in:
parent
ddb59425d0
commit
e519b2b9dc
|
@ -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-len(ids) if limit else limit) , context=context))
|
||||
ids = list(ids)
|
||||
if not ids:
|
||||
ptrn = re.compile('(\[(.*?)\])')
|
||||
|
|
Loading…
Reference in New Issue