first fistribution search class - inventory entry organization bug fixed
This commit is contained in:
16
apps/product/services/services.py
Normal file
16
apps/product/services/services.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from apps.warehouse.models import InventoryEntry
|
||||
|
||||
|
||||
def get_products_in_warehouse(organization_id):
|
||||
""" get list 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))
|
||||
|
||||
Reference in New Issue
Block a user