fix: refactor code for better translatable string in stock_ageing.py

This commit is contained in:
Ernesto Ruiz 2022-10-25 22:05:25 -06:00 committed by GitHub
parent a671652ab2
commit 71a0ae2e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -198,11 +198,11 @@ def setup_ageing_columns(filters: Filters, range_columns: List):
f"0 - {filters['range1']}",
f"{cint(filters['range1']) + 1} - {cint(filters['range2'])}",
f"{cint(filters['range2']) + 1} - {cint(filters['range3'])}",
f"{cint(filters['range3']) + 1} - {_('Above')}",
_("{0} - Above").format(cint(filters['range3']) + 1),
]
for i, label in enumerate(ranges):
fieldname = "range" + str(i + 1)
add_column(range_columns, label=f"Age ({label})", fieldname=fieldname)
add_column(range_columns, label=_("Age ({0})").format(label), fieldname=fieldname)
def add_column(