From 8d63d19d451de4b9ff50d1c34e8d3cd911af94c3 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 7 Mar 2024 09:14:56 +0530 Subject: [PATCH] fix: Filter for projects in Sales Cycle (cherry picked from commit d0e0b66b2f0586e93a3e3cc640036c8e311d2070) --- erpnext/controllers/queries.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 303548cca42..59060925025 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -338,7 +338,9 @@ def get_project_name(doctype, txt, searchfield, start, page_len, filters): ifelse = CustomFunction("IF", ["condition", "then", "else"]) if filters and filters.get("customer"): - qb_filter_and_conditions.append(proj.customer == filters.get("customer")) + qb_filter_and_conditions.append( + (proj.customer == filters.get("customer")) | proj.customer.isnull() | proj.customer == "" + ) qb_filter_and_conditions.append(proj.status.notin(["Completed", "Cancelled"]))