From 6d90c61761a290c433a1f7104b062d16285ffd57 Mon Sep 17 00:00:00 2001 From: Robert Einsle Date: Tue, 7 Sep 2021 11:42:01 +0200 Subject: [PATCH] add set to billed option --- billard/admin.py | 7 +++++++ caromserver/settings.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/billard/admin.py b/billard/admin.py index e61af64..1bcbd9b 100644 --- a/billard/admin.py +++ b/billard/admin.py @@ -83,12 +83,19 @@ class DeskAdmin(admin.ModelAdmin): list_filter = ('client', 'desk_no', 'enabled', 'prize', 'prize_hh') +@admin.action(description='Mark selected billings to billed') +def set_billing_true(modeladmin, request, queryset): + queryset.update(billing=True) + + @admin.register(Accounting) class AccountingAdmin(admin.ModelAdmin): list_display = ('desk', 'time_from', 'time_to', 'prize', 'billed', 'account_user', 'account_tst') list_filter = ('desk__client__location', 'account_user', 'account_tst', 'billed') + actions = [set_billing_true] def has_add_permission(self, request): if request.user.username == 'reinsle': return True return False + diff --git a/caromserver/settings.py b/caromserver/settings.py index 040b957..8b8c413 100644 --- a/caromserver/settings.py +++ b/caromserver/settings.py @@ -169,6 +169,8 @@ INTERNAL_IPS = ['127.0.0.1'] DJANGO_TABLES2_TEMPLATE = 'django_tables2/bootstrap4.html' +DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' + try: from local_settings import * except ImportError: