From 857d87da97d230367e1e5ac1e3fe8baa13b8130a Mon Sep 17 00:00:00 2001 From: Noah Jacob Date: Tue, 2 Nov 2021 17:52:45 +0530 Subject: [PATCH] fix: replaced "=" with "in" for multiple statuses in query #28193 fix: replaced "=" with "in" for multiple statuses in query --- .../purchase_order_analysis/purchase_order_analysis.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py index 1b25dd45d2..a566d56811 100644 --- a/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py +++ b/erpnext/buying/report/purchase_order_analysis/purchase_order_analysis.py @@ -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"