Merge pull request #17466 from deepeshgarg007/inactive-items-fix-develop

fix: Inactive sales items report fix
diff --git a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py
index 844942f..fd169f8f 100644
--- a/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py
+++ b/erpnext/accounts/report/inactive_sales_items/inactive_sales_items.py
@@ -80,27 +80,24 @@
 	sales_invoice_data = get_sales_details(filters)
 
 	for item in items:
+		row = {
+				"item_group": item.item_group,
+				"item": item.name,
+				"item_name": item.item_name
+		}
+
 		if sales_invoice_data.get(item.name):
 			item_obj = sales_invoice_data[item.name]
 			if item_obj.days_since_last_order > cint(filters['days']):
-				row = {
+				row.update({
 					"territory": item_obj.territory,
-					"item_group": item_obj.item_group,
-					"item": item_obj.name,
-					"item_name": item_obj.item_name,
 					"customer": item_obj.customer,
 					"last_order_date": item_obj.last_order_date,
 					"qty": item_obj.qty,
 					"days_since_last_order": item_obj.days_since_last_order
-				}
-				data.append(row)
-		else:
-			row = {
-				"item_group": item.item_group,
-				"item": item.name,
-				"item_name": item.item_name
-			}
-			data.append(row)
+				})
+
+		data.append(row)
 
 	return data
 
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 5a7ea32..97ad26e 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -599,3 +599,4 @@
 erpnext.patches.v11_1.woocommerce_set_creation_user
 erpnext.patches.v11_1.set_salary_details_submittable
 erpnext.patches.v11_1.rename_depends_on_lwp
+execute:frappe.delete_doc("Report", "Inactive Items")