fix access accounting objects
This commit is contained in:
Robert Einsle 2017-05-17 09:57:56 +02:00
parent 50823e5688
commit bc89db6179

View File

@ -43,7 +43,8 @@ class AccountingView(generic.ListView):
context_object_name = 'accounting' context_object_name = 'accounting'
def get_queryset(self): def get_queryset(self):
return Accounting.objects.filter(billed=False).exclude(time_to__isnull=True).order_by('time_from') return Accounting.objects.filter(billed=False).filter(desk__client__location_id=self.kwargs['pk'])\
.exclude(time_to__isnull=True).order_by('time_from')
def dispatch(self, request, *args, **kwargs): def dispatch(self, request, *args, **kwargs):
result = super(AccountingView, self).dispatch(request, *args, **kwargs) result = super(AccountingView, self).dispatch(request, *args, **kwargs)