From 97c46f140120fa5168834575db85b7bbb08ceb8d Mon Sep 17 00:00:00 2001 From: Charles-Henri Decultot Date: Mon, 7 Jul 2025 15:13:14 +0200 Subject: [PATCH] fix: Errors in report when user selects a group item group --- erpnext/selling/report/sales_analytics/sales_analytics.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.py b/erpnext/selling/report/sales_analytics/sales_analytics.py index f20f78d741..17c38bb525 100644 --- a/erpnext/selling/report/sales_analytics/sales_analytics.py +++ b/erpnext/selling/report/sales_analytics/sales_analytics.py @@ -491,8 +491,8 @@ class Analytics: ) for d in self.group_entries: - if d.parent: - self.depth_map.setdefault(d.name, self.depth_map.get(d.parent) + 1) + if d.parent and (depth_map := self.depth_map.get(d.parent)): # @dokos + self.depth_map.setdefault(d.name, depth_map + 1) # @dokos else: self.depth_map.setdefault(d.name, 0) @@ -508,8 +508,8 @@ class Analytics: ) for d in self.group_entries: - if d.parent: - self.depth_map.setdefault(d.name, self.depth_map.get(d.parent) + 1) + if d.parent and (depth_map := self.depth_map.get(d.parent)): # @dokos + self.depth_map.setdefault(d.name, depth_map + 1) # @dokos else: self.depth_map.setdefault(d.name, 0) -- GitLab