fix - pos sharing on agc bug fixed influently
This commit is contained in:
@@ -274,8 +274,13 @@ class OrganizationQuotaStatsSerializer(serializers.ModelSerializer):
|
||||
representation['free_sale'] = instance.quota.free_sale
|
||||
representation['pre_sale'] = instance.quota.pre_sale
|
||||
|
||||
if instance.distributions:
|
||||
representation['distribution'] = instance.distributions.all().order_by('-create_date').first().id
|
||||
last_distribution = (
|
||||
instance.distributions
|
||||
.order_by('-create_date')
|
||||
.first()
|
||||
)
|
||||
|
||||
representation['distribution'] = last_distribution.id if last_distribution else None
|
||||
|
||||
if instance.quota:
|
||||
representation['quota'] = {
|
||||
|
||||
@@ -229,6 +229,7 @@ class OrganizationQuotaStatsViewSet(viewsets.ModelViewSet, DynamicSearchMixin, P
|
||||
quotas = self.queryset.filter(
|
||||
Q(organization=organization),
|
||||
Q(quota__is_closed=False),
|
||||
Q(total_amount__gt=0),
|
||||
(
|
||||
Q(quota__pre_sale=True) | Q(quota__free_sale=True) | Q(inventory_received__gt=0)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user