fix - quota dashboard by product

This commit is contained in:
2025-12-10 17:07:36 +03:30
parent 1f834ff3c5
commit b7bf70703c

View File

@@ -111,10 +111,16 @@ class QuotaDashboardService:
stat_by_prod = []
for prod_name, prod_id in products.items():
org_quota_stat = OrganizationQuotaStats.objects.filter(
organization=organization,
quota__product_id=prod_id
)
if organization.type.key == 'ADM':
org_quota_stat = OrganizationQuotaStats.objects.filter(
quota__product_id=prod_id,
stat_type='quota',
)
else:
org_quota_stat = OrganizationQuotaStats.objects.filter(
organization=organization,
quota__product_id=prod_id
)
# filter queryset (transactions & items) by date
if (start_date and end_date) or query_string: