Sort report options by name, when choosing which to generate

This commit is contained in:
Lance Edgar 2020-01-28 06:47:59 -06:00
parent 99f1e000bf
commit 6e7ee99b47

View file

@ -305,6 +305,7 @@ class GenerateReport(View):
# TODO: should probably "group" certain reports together somehow?
# e.g. some for customers/membership, others for product movement etc.
values = [(r.type_key, r.name) for r in reports.values()]
values.sort(key=lambda r: r[1])
if use_buefy:
form.set_widget('report_type', forms.widgets.CustomSelectWidget(values=values, size=10))
form.widgets['report_type'].set_template_values(input_handler='reportTypeChanged')