From 7230f9c5357ec38fb7ffea8f7443803cbdd1ed74 Mon Sep 17 00:00:00 2001 From: Pierre-antoine Comby Date: Sun, 23 Feb 2020 18:56:03 +0100 Subject: [PATCH] transaction_type -> category --- apps/note/views.py | 4 ++-- templates/note/conso_form.html | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/note/views.py b/apps/note/views.py index 167ef4f0..c42c243f 100644 --- a/apps/note/views.py +++ b/apps/note/views.py @@ -138,8 +138,8 @@ class ConsoView(LoginRequiredMixin, CreateView): Add some context variables in template such as page title """ context = super().get_context_data(**kwargs) - context['transaction_templates'] = TransactionTemplate.objects.all() \ - .order_by('template_type') + context['transaction_templates'] = TransactionTemplate.objects.filter(display=True) \ + .order_by('category') context['title'] = _("Consommations") # select2 compatibility diff --git a/templates/note/conso_form.html b/templates/note/conso_form.html index b121ad54..10b06589 100644 --- a/templates/note/conso_form.html +++ b/templates/note/conso_form.html @@ -7,7 +7,7 @@ {% block content %} {# Regroup buttons under categories #} - {% regroup transaction_templates by template_type as template_types %} + {% regroup transaction_templates by category as categories %}
{% csrf_token %} @@ -44,10 +44,10 @@ {# Tabs for button categories #}