diff --git a/financial_settlement/views.py b/financial_settlement/views.py index ac02267763264bb0bbdafe518db183361b28f5dd..cdd88bb1b2c69988e08d610066aeba27590ac5bc 100644 --- a/financial_settlement/views.py +++ b/financial_settlement/views.py @@ -1,5 +1,6 @@ from django.contrib.auth.decorators import permission_required from django.contrib.auth.decorators import permission_required +from django.db.models import Q from django.shortcuts import get_object_or_404, render, redirect from django.utils.translation import gettext_lazy as _ @@ -78,9 +79,11 @@ def statement_detail(request, pk): :return: Redirecting to fin_statement_details """ statement = get_object_or_404(FinStatement, pk=pk) - unified_frames = UnifiedFrame.objects.filter(fin_statement=statement, status=choices.FrameStatus.READY) - mappings = UnifiedFrame2SlowalFrameMapping.objects.filter(unified_frame__in=unified_frames.all(), - slowal_frame__status=choices.FrameStatus.READY) + unified_frames = UnifiedFrame.objects.filter(Q(Q(fin_statement=statement, status=choices.FrameStatus.READY) | + Q(fin_statement=statement, status=choices.FrameStatus.VERIFIED))) + mappings = UnifiedFrame2SlowalFrameMapping.objects.filter(Q(Q(unified_frame__in=unified_frames.all()) & + Q(Q(slowal_frame__status=choices.FrameStatus.READY) | + Q(slowal_frame__status=choices.FrameStatus.VERIFIED)))) free_lu_frames = Frame.objects.filter(free_lu_user_assignment=statement.user, fin_statement=statement) return render(request, 'fin_statement_details.html',