mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 00:14:50 +00:00
fix: replaced "=" with "in" for multiple statuses in query
(cherry picked from commit 857d87da97)
Co-authored-by: Noah Jacob <noahjacobkurian@gmail.com>
This commit is contained in:
@@ -41,10 +41,13 @@ def get_conditions(filters):
|
|||||||
if filters.get("from_date") and filters.get("to_date"):
|
if filters.get("from_date") and filters.get("to_date"):
|
||||||
conditions += " and po.transaction_date between %(from_date)s and %(to_date)s"
|
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):
|
if filters.get(field):
|
||||||
conditions += f" and po.{field} = %({field})s"
|
conditions += f" and po.{field} = %({field})s"
|
||||||
|
|
||||||
|
if filters.get('status'):
|
||||||
|
conditions += " and po.status in %(status)s"
|
||||||
|
|
||||||
if filters.get('project'):
|
if filters.get('project'):
|
||||||
conditions += " and poi.project = %(project)s"
|
conditions += " and poi.project = %(project)s"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user