fix --> bug of transactions dashboard with free visibility scope on queryset

This commit is contained in:
2026-02-02 10:25:05 +03:30
parent 56025d77b1
commit 0b08107c14
3 changed files with 45 additions and 22 deletions

View File

@@ -280,13 +280,25 @@ class InventoryQuotaSaleTransactionViewSet(
transaction_status = query_param.get('status') if 'status' in query_param.keys() else None
org = get_organization_by_user(request.user)
# filer by date & transaction status
transaction_dashboard_data = self.get_dashboard(
org,
start_date=start_date,
end_date=end_date,
status=transaction_status
)
if org.free_visibility_by_scope:
tr_objects = self.get_queryset(visibility_by_org_scope=True)
tr_item_objects = InventoryQuotaSaleItemViewSet().get_queryset(visibility_by_org_scope=True)
transaction_dashboard_data = self.get_dashboard(
org,
free_visibility_tr_objects=tr_objects,
free_visibility_tr_item_objects=tr_item_objects,
start_date=start_date,
end_date=end_date,
status=transaction_status,
)
else:
# filer by date & transaction status
transaction_dashboard_data = self.get_dashboard(
org,
start_date=start_date,
end_date=end_date,
status=transaction_status,
)
return Response(transaction_dashboard_data, status=status.HTTP_200_OK)