From de06cb7f45dd28ce6893b12697104c409b06b70c Mon Sep 17 00:00:00 2001 From: soulxone Date: Tue, 11 Aug 2026 11:48:41 -0500 Subject: [PATCH] fix(Material Requirements Planning Report): detailed-view chart timescale The detailed-view chart collapsed every row into a single "today" column and was additionally capped at 10 points, so the chart never matched the report's date filters or the table data. Two causes in get_detailed_view_chart_data: 1. `row.deliver_date` was a typo for `row.delivery_date` (the name used everywhere else in this report). On a frappe._dict the missing attribute resolves to None, so `getdate(None)` returned today and the past-date filter silently compared every row against today instead of its own delivery date. 2. A hard `if i == 10: break` truncated the chart to 10 date buckets. Use the correct field name and drop the cap. The null check now runs before the date comparison, since `getdate(None)` returning today meant the original ordering could never filter a null delivery_date out. Fixes #52632 (cherry picked from commit 3c17a604be62cd192753ab266e679e26c88a1113) --- .../material_requirements_planning_report.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/erpnext/manufacturing/report/material_requirements_planning_report/material_requirements_planning_report.py b/erpnext/manufacturing/report/material_requirements_planning_report/material_requirements_planning_report.py index fc987d29f93..6831d75d542 100644 --- a/erpnext/manufacturing/report/material_requirements_planning_report/material_requirements_planning_report.py +++ b/erpnext/manufacturing/report/material_requirements_planning_report/material_requirements_planning_report.py @@ -268,22 +268,17 @@ class MaterialRequirementsPlanningReport: def get_detailed_view_chart_data(self, data): chart_data = frappe._dict({}) - i = 0 sorted_data = sorted(data, key=lambda x: getdate(x.get("delivery_date"))) for row in sorted_data: - if getdate(row.deliver_date) < getdate(today()): - continue - if not row.delivery_date: continue - if i == 10: - break + if getdate(row.delivery_date) < getdate(today()): + continue delivery_date = formatdate(row.delivery_date, "dd MMM") if delivery_date not in chart_data: - i += 1 chart_data[delivery_date] = frappe._dict( { "demand": 0.0,