From db93e50f16da1624ff8108d5db8af3626a5438b0 Mon Sep 17 00:00:00 2001 From: "matteo.arosti" Date: Tue, 14 Oct 2025 00:27:27 +0200 Subject: [PATCH] fix: warehouse source reference in production report (cherry picked from commit 451651e350f014b77f20d0787c0069ce380ff72f) --- .../production_planning_report.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 63af3e5cbe6..9867db0dd1c 100644 --- a/erpnext/manufacturing/report/production_planning_report/production_planning_report.py +++ b/erpnext/manufacturing/report/production_planning_report/production_planning_report.py @@ -113,6 +113,13 @@ class ProductionPlanReport: self.orders = query.run(as_dict=True) def get_raw_materials(self): + """Retrieve raw materials and source warehouses for production orders. + + This method collects BOM or Work Order items depending on the selected + filter and updates `self.raw_materials_dict`, `self.warehouses`, + and `self.item_codes` accordingly. + """ + if not self.orders: return self.warehouses = [d.warehouse for d in self.orders] @@ -135,7 +142,7 @@ class ProductionPlanReport: ) or [] ) - self.warehouses.extend([d.source_warehouse for d in raw_materials]) + self.warehouses.extend([d.warehouse for d in raw_materials]) else: bom_nos = []