From 040873a442c971a977412272b099b54c28a782ce Mon Sep 17 00:00:00 2001 From: l0gesh29 Date: Fri, 3 Oct 2025 14:03:28 +0530 Subject: [PATCH] fix: delete column dynamically based on the naming by (cherry picked from commit 4f503ac7f677696dee18db600b5b05893c214e72) --- erpnext/accounts/report/gross_profit/gross_profit.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 5081c450151..367fe4f4fd2 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -178,7 +178,12 @@ def get_data_when_grouped_by_invoice(columns, gross_profit_data, filters, group_ # to display item as Item Code: Item Name columns[0] = "Sales Invoice:Link/Item:300" # removing Item Code and Item Name columns - del columns[4:6] + 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] + else: + del columns[5:7] total_base_amount = 0 total_buying_amount = 0 @@ -275,7 +280,7 @@ def get_columns(group_wise_columns, filters): "label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", - "width": 100, + "width": 120, }, "posting_time": { "label": _("Posting Time"),