Added explicit parentheses around customer OR conditions in get_project_name()
to ensure proper grouping with AND filters. Without these parentheses, SQL
operator precedence caused the status filter to be bypassed when a customer
filter was applied, resulting in completed and cancelled projects appearing
in link field dropdowns.
Before:
WHERE customer='X' OR customer IS NULL OR customer='' AND status NOT IN (...)
was interpreted as:
WHERE customer='X' OR customer IS NULL OR (customer='' AND status NOT IN (...))
After:
WHERE (customer='X' OR customer IS NULL OR customer='') AND status NOT IN (...)
Fixes: Completed/cancelled projects showing in Project link fields
Affected: Any doctype using Project link fields with customer filters
(cherry picked from commit 0ec30a1cea)