Added the account list view in the accounting application.

This commit is contained in:
依瑪貓
2020-08-07 10:11:09 +08:00
parent 1a2bada988
commit 45ed53b085
2 changed files with 98 additions and 1 deletions

View File

@ -33,7 +33,7 @@ from django.utils import timezone
from django.utils.decorators import method_decorator
from django.utils.translation import gettext as _, gettext_noop
from django.views.decorators.http import require_GET, require_POST
from django.views.generic import RedirectView
from django.views.generic import RedirectView, ListView
from mia_core.digest_auth import login_required
from mia_core.period import Period
@ -1051,6 +1051,14 @@ def txn_sort(request, date):
return success_redirect(request, url, message)
@method_decorator(require_GET, name="dispatch")
@method_decorator(login_required, name="dispatch")
class AccountListView(ListView):
"""The view to list the accounts."""
queryset = Account.objects.order_by("code")
template_name = "accounting/accounts/index.html"
@require_GET
@login_required
def account_options(request):