diff --git a/counter/views.py b/counter/views.py index 5d1c5f34..6962e2f3 100644 --- a/counter/views.py +++ b/counter/views.py @@ -800,8 +800,8 @@ class CounterLastOperationsView(CounterTabsMixin, CanViewMixin, DetailView): """Add form to the context """ kwargs = super(CounterLastOperationsView, self).get_context_data(**kwargs) threshold = timezone.now() - timedelta(minutes=settings.SITH_LAST_OPERATIONS_LIMIT) - kwargs['last_refillings'] = self.object.refillings.filter(date__gte=threshold).all() - kwargs['last_sellings'] = self.object.sellings.filter(date__gte=threshold).all() + kwargs['last_refillings'] = self.object.refillings.filter(date__gte=threshold).order_by('-id')[:20] + kwargs['last_sellings'] = self.object.sellings.filter(date__gte=threshold).order_by('-id')[:20] return kwargs class CounterCashSummaryView(CounterTabsMixin, CanViewMixin, DetailView): diff --git a/sith/settings.py b/sith/settings.py index c88b1f24..e2afe980 100644 --- a/sith/settings.py +++ b/sith/settings.py @@ -434,7 +434,7 @@ SITH_MAXIMUM_FREE_ROLE=1 SITH_BARMAN_TIMEOUT=20 # Minutes to delete the last operations -SITH_LAST_OPERATIONS_LIMIT=5 +SITH_LAST_OPERATIONS_LIMIT=10 # Minutes for a counter to be inactive SITH_COUNTER_MINUTE_INACTIVE=10