feat: sticky columns in reports

Co-authored-by: diptanilsaha <diptanil@frappe.io>
This commit is contained in:
Ejaaz Khan
2026-03-31 15:07:25 +05:30
parent 5c95f3347b
commit 03e4df7a1a
4 changed files with 23 additions and 3 deletions

View File

@@ -1199,6 +1199,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")
@@ -1213,6 +1214,7 @@ class ReceivablePayableReport:
fieldtype="Link",
options="Account",
width=180,
sticky=True,
)
if self.party_naming_by == "Naming Series":
@@ -1226,6 +1228,7 @@ class ReceivablePayableReport:
label=label,
fieldname=fieldname,
fieldtype="Data",
sticky=True,
)
if self.account_type == "Receivable":
@@ -1309,7 +1312,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":
@@ -1318,7 +1321,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

@@ -676,13 +676,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),

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},
{