diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 463cb859970..03852d3739a 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -271,10 +271,14 @@ def get_project_name(doctype, txt, searchfield, start, page_len, filters): qb_filter_or_conditions = [] ifelse = CustomFunction("IF", ["condition", "then", "else"]) - if filters and filters.get("customer"): - qb_filter_and_conditions.append( - (proj.customer == filters.get("customer")) | proj.customer.isnull() | proj.customer == "" - ) + if filters: + if filters.get("customer"): + qb_filter_and_conditions.append( + (proj.customer == filters.get("customer")) | proj.customer.isnull() | proj.customer == "" + ) + + if filters.get("company"): + qb_filter_and_conditions.append(proj.company == filters.get("company")) qb_filter_and_conditions.append(proj.status.notin(["Completed", "Cancelled"]))