Sort report options by name, when choosing which to generate
This commit is contained in:
parent
99f1e000bf
commit
6e7ee99b47
|
@ -305,6 +305,7 @@ class GenerateReport(View):
|
||||||
# TODO: should probably "group" certain reports together somehow?
|
# TODO: should probably "group" certain reports together somehow?
|
||||||
# e.g. some for customers/membership, others for product movement etc.
|
# e.g. some for customers/membership, others for product movement etc.
|
||||||
values = [(r.type_key, r.name) for r in reports.values()]
|
values = [(r.type_key, r.name) for r in reports.values()]
|
||||||
|
values.sort(key=lambda r: r[1])
|
||||||
if use_buefy:
|
if use_buefy:
|
||||||
form.set_widget('report_type', forms.widgets.CustomSelectWidget(values=values, size=10))
|
form.set_widget('report_type', forms.widgets.CustomSelectWidget(values=values, size=10))
|
||||||
form.widgets['report_type'].set_template_values(input_handler='reportTypeChanged')
|
form.widgets['report_type'].set_template_values(input_handler='reportTypeChanged')
|
||||||
|
|
Loading…
Reference in a new issue