Browse Source

Respect limits and remove duplicates

pull/20/head
Sandy Carter 10 years ago
parent
commit
64c0713f00
  1. 4
      base_contact_function/res_partner_category.py

4
base_contact_function/res_partner_category.py

@ -49,9 +49,11 @@ class res_partner_category(orm.Model):
if ids:
child_ids = self.search(
cr, user, [('parent_id', 'child_of', ids)],
context=context)
limit=limit, context=context)
if child_ids:
ids.extend(child_ids)
# Remove duplicates and respect limit
ids = list(set(ids))[:limit]
else:
ids = self.search(cr, user, args, limit=limit, context=context)
return self.name_get(cr, user, ids, context)
Loading…
Cancel
Save