From 59b80b903a25c661f448e11633d74c0566913391 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 8 Sep 2026 18:20:34 +0530 Subject: [PATCH] fix(gross-profit): include item_name in export (backport #58631) (#58864) Co-authored-by: Vishnu Priya Baskaran <145791817+ervishnucs@users.noreply.github.com> --- erpnext/accounts/report/gross_profit/gross_profit.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index d73faead0f7..dd9435bd609 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -180,13 +180,15 @@ def get_data_when_grouped_by_invoice(columns, gross_profit_data, filters, group_ columns[0]["fieldname"] = "sales_invoice" columns[0]["options"] = "Item" columns[0]["width"] = 300 - # removing Item Code and Item Name columns + # removing the duplicate Item Code column and moving Item Name before Customer supplier_master_name = frappe.db.get_single_value("Buying Settings", "supp_master_name") customer_master_name = frappe.db.get_single_value("Selling Settings", "cust_master_name") if supplier_master_name == "Supplier Name" and customer_master_name == "Customer Name": - del columns[4:6] + del columns[4] + columns.insert(1, columns.pop(4)) else: - del columns[5:7] + del columns[5] + columns.insert(1, columns.pop(5)) total_base_amount = 0 total_buying_amount = 0