refactor: date filters should be explicit

(cherry picked from commit 40c166a0a0)
This commit is contained in:
ruthra kumar
2024-07-31 14:01:27 +05:30
committed by Mergify
parent e1da019fe7
commit 703f58ceac

View File

@@ -147,6 +147,10 @@ class SalesPipelineAnalytics:
conditions.append(
["expected_closing", "between", [self.filters.get("from_date"), self.filters.get("to_date")]]
)
elif self.filters.get("from_date") and not self.filters.get("to_date"):
conditions.append(["expected_closing", ">=", self.filters.get("from_date")])
elif not self.filters.get("from_date") and self.filters.get("to_date"):
conditions.append(["expected_closing", "<=", self.filters.get("to_date")])
return conditions