From 6e7ee99b476b8c72a8b423e8ddff010b4d84b64b Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 28 Jan 2020 06:47:59 -0600 Subject: [PATCH] Sort report options by name, when choosing which to generate --- tailbone/views/reports.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tailbone/views/reports.py b/tailbone/views/reports.py index c13c6af1..7fbdde03 100644 --- a/tailbone/views/reports.py +++ b/tailbone/views/reports.py @@ -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')