Merge pull request #55891 from frappe/mergify/bp/version-16-hotfix/pr-53949

feat: sticky columns in reports (backport #53949)
This commit is contained in:
Ejaaz Khan
2026-06-15 13:00:39 +05:30
committed by GitHub
4 changed files with 24 additions and 4 deletions

View File

@@ -1149,6 +1149,7 @@ class ReceivablePayableReport:
fieldtype="Dynamic Link",
options="party_type",
width=180,
sticky=(self.party_naming_by not in ["Naming Series", "Auto Name"]),
)
if self.account_type == "Receivable":
label = _("Receivable Account")
@@ -1163,6 +1164,7 @@ class ReceivablePayableReport:
fieldtype="Link",
options="Account",
width=180,
sticky=True,
)
if self.party_naming_by == "Naming Series":
@@ -1176,6 +1178,7 @@ class ReceivablePayableReport:
label=label,
fieldname=fieldname,
fieldtype="Data",
sticky=True,
)
if self.account_type == "Receivable":
@@ -1260,7 +1263,7 @@ class ReceivablePayableReport:
if self.filters.show_remarks:
self.add_column(label=_("Remarks"), fieldname="remarks", fieldtype="Text", width=200)
def add_column(self, label, fieldname=None, fieldtype="Currency", options=None, width=120):
def add_column(self, label, fieldname=None, fieldtype="Currency", options=None, width=120, sticky=False):
if not fieldname:
fieldname = scrub(label)
if fieldtype == "Currency":
@@ -1269,7 +1272,14 @@ class ReceivablePayableReport:
width = 90
self.columns.append(
dict(label=label, fieldname=fieldname, fieldtype=fieldtype, options=options, width=width)
dict(
label=label,
fieldname=fieldname,
fieldtype=fieldtype,
options=options,
width=width,
sticky=sticky,
)
)
def setup_ageing_columns(self):

View File

@@ -693,13 +693,20 @@ def get_columns(filters):
"options": "GL Entry",
"hidden": 1,
},
{"label": _("Posting Date"), "fieldname": "posting_date", "fieldtype": "Date", "width": 120},
{
"label": _("Posting Date"),
"fieldname": "posting_date",
"fieldtype": "Date",
"width": 120,
"sticky": True,
},
{
"label": _("Account"),
"fieldname": "account",
"fieldtype": "Link",
"options": "Account",
"width": 180,
"sticky": True,
},
{
"label": _("Debit ({0})").format(currency),
@@ -741,7 +748,7 @@ def get_columns(filters):
"options": "transaction_currency",
},
{
"label": "Transaction Currency",
"label": _("Transaction Currency"),
"fieldname": "transaction_currency",
"fieldtype": "Link",
"options": "Currency",

View File

@@ -28,6 +28,7 @@ def get_columns(filters):
"fieldname": "item_code",
"options": "Item",
"width": 120,
"sticky": True,
},
{
"label": _("Item Name"),
@@ -41,6 +42,7 @@ def get_columns(filters):
"fieldname": "item_group",
"options": "Item Group",
"width": 120,
"sticky": True,
},
{
"label": _("Description"),

View File

@@ -29,6 +29,7 @@ def get_columns(filters):
"fieldname": "item_code",
"options": "Item",
"width": 120,
"sticky": True,
},
{"label": _("Item Name"), "fieldtype": "Data", "fieldname": "item_name", "width": 140},
{