fix: replaced "=" with "in" for multiple statuses in query #28193

fix: replaced "=" with "in" for multiple statuses in query
This commit is contained in:
Noah Jacob 2021-11-02 17:52:45 +05:30 committed by GitHub
parent d72709dd81
commit 857d87da97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,10 +41,13 @@ def get_conditions(filters):
if filters.get("from_date") and filters.get("to_date"):
conditions += " and po.transaction_date between %(from_date)s and %(to_date)s"
for field in ['company', 'name', 'status']:
for field in ['company', 'name']:
if filters.get(field):
conditions += f" and po.{field} = %({field})s"
if filters.get('status'):
conditions += " and po.status in %(status)s"
if filters.get('project'):
conditions += " and poi.project = %(project)s"