fix: order status in `Production Planning Report`
diff --git a/erpnext/manufacturing/report/production_planning_report/production_planning_report.py b/erpnext/manufacturing/report/production_planning_report/production_planning_report.py
index 16c25ce..109d9ab 100644
--- a/erpnext/manufacturing/report/production_planning_report/production_planning_report.py
+++ b/erpnext/manufacturing/report/production_planning_report/production_planning_report.py
@@ -49,7 +49,7 @@
parent.bom_no,
parent.fg_warehouse.as_("warehouse"),
)
- .where(parent.status.notin(["Completed", "Stopped"]))
+ .where(parent.status.notin(["Completed", "Stopped", "Closed"]))
)
if order_by == "Planned Start Date":
@@ -79,10 +79,11 @@
query = query.where(child.parent.isin(self.filters.docnames))
if doctype == "Sales Order":
- query = query.select(
- child.delivery_date,
- parent.base_grand_total,
- ).where((child.stock_qty > child.produced_qty) & (parent.per_delivered < 100.0))
+ query = query.select(child.delivery_date, parent.base_grand_total,).where(
+ (child.stock_qty > child.produced_qty)
+ & (parent.per_delivered < 100.0)
+ & (parent.status.notin(["Completed", "Closed"]))
+ )
if order_by == "Delivery Date":
query = query.orderby(child.delivery_date, order=Order.asc)
@@ -91,7 +92,9 @@
elif doctype == "Material Request":
query = query.select(child.schedule_date,).where(
- (parent.per_ordered < 100) & (parent.material_request_type == "Manufacture")
+ (parent.per_ordered < 100)
+ & (parent.material_request_type == "Manufacture")
+ & (parent.status != "Stopped")
)
if order_by == "Required Date":