add product serialize to broker - quota statistic by product

This commit is contained in:
2025-07-08 11:59:58 +03:30
parent bafd1fbbcb
commit 90b090e848
5 changed files with 41 additions and 5 deletions

View File

@@ -0,0 +1,16 @@
from apps.warehouse.models import InventoryEntry
def get_products_in_warehouse(organization_id):
""" get lis of products from organization warehouse """
entries = InventoryEntry.objects.select_related(
'distribution__quota__product'
)
product_objects = [
entry.distribution.quota.product for entry in entries
]
return list(set(product_objects))