refactor: extract non-labelable fieldtypes to constant

This commit is contained in:
Kaushal Shriwas 2026-04-30 15:24:38 +05:30
parent ede2dea043
commit eb76248c99

View file

@ -678,6 +678,9 @@ def get_xlsx_styles(metadata: XLSXMetadata, report_name: str | None = None) -> d
return styles return styles
NON_LABELABLE_FIELDTYPES = ("Currency", "Int", "Float", "Percent", "Date", "Datetime", "Time")
def add_total_row( def add_total_row(
result, result,
columns, columns,
@ -751,7 +754,7 @@ def add_total_row(
else: else:
first_col_fieldtype = columns[0].get("fieldtype") first_col_fieldtype = columns[0].get("fieldtype")
if first_col_fieldtype not in ["Currency", "Int", "Float", "Percent", "Date", "Datetime", "Time"]: if first_col_fieldtype not in NON_LABELABLE_FIELDTYPES:
total_row[0] = _("Total") total_row[0] = _("Total")
result.append(total_row) result.append(total_row)