fix - distributions list bug for presale & free sale on pos
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from django.db import transaction
|
from django.db import transaction
|
||||||
|
from django.db.models import Q
|
||||||
from rest_framework import status
|
from rest_framework import status
|
||||||
from rest_framework import viewsets
|
from rest_framework import viewsets
|
||||||
from rest_framework.decorators import action
|
from rest_framework.decorators import action
|
||||||
@@ -61,9 +62,11 @@ class QuotaDistributionViewSet(viewsets.ModelViewSet, DynamicSearchMixin, POSDev
|
|||||||
|
|
||||||
# get distributions with open quota
|
# get distributions with open quota
|
||||||
distributions = self.queryset.filter(
|
distributions = self.queryset.filter(
|
||||||
assigned_organization=organization,
|
Q(assigned_organization=organization),
|
||||||
quota__is_closed=False,
|
Q(quota__is_closed=False),
|
||||||
warehouse_entry__gt=0
|
(
|
||||||
|
Q(pre_sale=True) | Q(free_sale=True) | Q(warehouse_entry__gt=0)
|
||||||
|
)
|
||||||
).order_by('-create_date')
|
).order_by('-create_date')
|
||||||
|
|
||||||
queryset = self.filter_query(distributions) # return by search param or all objects
|
queryset = self.filter_query(distributions) # return by search param or all objects
|
||||||
|
|||||||
Reference in New Issue
Block a user