diff --git a/frappe/model/base_document.py b/frappe/model/base_document.py index eeef552a8a..6353eff95d 100644 --- a/frappe/model/base_document.py +++ b/frappe/model/base_document.py @@ -1008,15 +1008,12 @@ def _filter(data, filters, limit=None): _filters[f] = fval for d in data: - add = True for f, fval in _filters.items(): if not frappe.compare(getattr(d, f, None), fval[0], fval[1]): - add = False break - - if add: + else: out.append(d) - if limit and (len(out)-1)==limit: + if limit and len(out) >= limit: break return out