From 9bf308ce9a90dec82affe7104cb887dad1a25fb0 Mon Sep 17 00:00:00 2001 From: Robert Einsle Date: Tue, 7 Sep 2021 11:54:15 +0200 Subject: [PATCH] add set to billed option --- billard/admin.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/billard/admin.py b/billard/admin.py index 1bcbd9b..8755696 100644 --- a/billard/admin.py +++ b/billard/admin.py @@ -83,19 +83,18 @@ 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] + actions = ['mark_billed'] def has_add_permission(self, request): if request.user.username == 'reinsle': return True return False + @admin.action(description='Markiere selektierte als bezahlt') + def mark_billed(self, request, queryset): + queryset.update(billed=True) +