From e59040c3601a0686f70d28b6dcb2a1e25040ba33 Mon Sep 17 00:00:00 2001 From: Mojtaba-z Date: Sat, 29 Nov 2025 09:33:22 +0330 Subject: [PATCH] fix - admin can see registere org quotas --- apps/product/models.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/product/models.py b/apps/product/models.py index 8fd86cd..8e47dfc 100644 --- a/apps/product/models.py +++ b/apps/product/models.py @@ -469,12 +469,21 @@ class Quota(BaseModel): """ get stats of quota from org quota stat model """ + stat = OrganizationQuotaStats.objects.filter( quota=self, organization=org ) - if not stat.exists(): + if not stat.exists() and org.type.key == 'ADM': + # if org is admin just see the quota was created by registerer org + org = self.registerer_organization + stat = OrganizationQuotaStats.objects.filter( + quota=self, + organization=org + ) + + elif not stat.exists(): # get childs of organization org_childs = get_all_org_child(org) # noqa