rancher incentive quota usage - pos product search
This commit is contained in:
@@ -29,7 +29,7 @@ def delete(queryset, pk):
|
||||
obj.delete()
|
||||
|
||||
|
||||
class ProductCategoryViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin):
|
||||
class ProductCategoryViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
queryset = product_models.ProductCategory.objects.all()
|
||||
serializer_class = product_serializers.ProductCategorySerializer
|
||||
filter_backends = [filters.SearchFilter]
|
||||
@@ -67,7 +67,7 @@ class ProductCategoryViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSear
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class ProductViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin):
|
||||
class ProductViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
queryset = product_models.Product.objects.all()
|
||||
serializer_class = product_serializers.ProductSerializer
|
||||
filter_backends = [filters.SearchFilter]
|
||||
@@ -146,7 +146,7 @@ class ProductViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin)
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class ProductStatsViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin):
|
||||
class ProductStatsViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
""" product statistics by its quotas """
|
||||
|
||||
queryset = product_models.ProductStats.objects.all()
|
||||
@@ -177,7 +177,7 @@ class ProductStatsViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchM
|
||||
raise e
|
||||
|
||||
|
||||
class AttributeViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin):
|
||||
class AttributeViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
""" attributes of reference product """ #
|
||||
|
||||
queryset = product_models.Attribute.objects.select_related('product').all()
|
||||
@@ -235,7 +235,7 @@ class AttributeViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixi
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class AttributeValueViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin):
|
||||
class AttributeValueViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
""" apis for attribute values of child products """ # noqa
|
||||
|
||||
queryset = product_models.AttributeValue.objects.all()
|
||||
@@ -273,7 +273,7 @@ class AttributeValueViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearc
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class BrokerViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin):
|
||||
class BrokerViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
""" apis of product brokers """ # noqa
|
||||
|
||||
queryset = product_models.Broker.objects.all()
|
||||
@@ -313,7 +313,7 @@ class BrokerViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin):
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class SaleUnitViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin):
|
||||
class SaleUnitViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
""" apis of unit of sale for products """ # noqa
|
||||
|
||||
queryset = product_models.SaleUnit.objects.all()
|
||||
@@ -353,7 +353,7 @@ class SaleUnitViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class IncentivePlanViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin): # noqa
|
||||
class IncentivePlanViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin): # noqa
|
||||
""" apis for incentive plan """
|
||||
|
||||
queryset = product_models.IncentivePlan.objects.all()
|
||||
@@ -443,7 +443,7 @@ class IncentivePlanViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearch
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class IncentivePlanRancherViewSet(viewsets.ModelViewSet, SoftDeleteMixin, DynamicSearchMixin):
|
||||
class IncentivePlanRancherViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
queryset = product_models.IncentivePlanRancher.objects.all()
|
||||
serializer_class = product_serializers.IncentivePlanRancherSerializer
|
||||
search_fields = []
|
||||
|
||||
@@ -32,7 +32,7 @@ def delete(queryset, pk):
|
||||
obj.delete()
|
||||
|
||||
|
||||
class QuotaViewSet(viewsets.ModelViewSet, DynamicSearchMixin, SoftDeleteMixin): # noqa
|
||||
class QuotaViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin): # noqa
|
||||
""" apis for product quota """
|
||||
|
||||
queryset = product_models.Quota.objects.all()
|
||||
@@ -454,7 +454,7 @@ class QuotaViewSet(viewsets.ModelViewSet, DynamicSearchMixin, SoftDeleteMixin):
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class QuotaIncentiveAssignmentViewSet(viewsets.ModelViewSet, SoftDeleteMixin): # noqa
|
||||
class QuotaIncentiveAssignmentViewSet(SoftDeleteMixin, viewsets.ModelViewSet): # noqa
|
||||
""" apis for incentive assignment """
|
||||
|
||||
queryset = product_models.QuotaIncentiveAssignment.objects.all()
|
||||
@@ -492,7 +492,7 @@ class QuotaIncentiveAssignmentViewSet(viewsets.ModelViewSet, SoftDeleteMixin):
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class QuotaBrokerValueViewSet(viewsets.ModelViewSet, SoftDeleteMixin): # noqa
|
||||
class QuotaBrokerValueViewSet(SoftDeleteMixin, viewsets.ModelViewSet): # noqa
|
||||
""" apis for quota broker value """
|
||||
|
||||
queryset = product_models.QuotaBrokerValue.objects.all()
|
||||
@@ -530,7 +530,7 @@ class QuotaBrokerValueViewSet(viewsets.ModelViewSet, SoftDeleteMixin): # noqa
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class QuotaLiveStockAllocationViewSet(viewsets.ModelViewSet, SoftDeleteMixin):
|
||||
class QuotaLiveStockAllocationViewSet(SoftDeleteMixin, viewsets.ModelViewSet):
|
||||
""" apis for quota livestock allocation """
|
||||
|
||||
queryset = product_models.QuotaLivestockAllocation.objects.all()
|
||||
@@ -568,7 +568,7 @@ class QuotaLiveStockAllocationViewSet(viewsets.ModelViewSet, SoftDeleteMixin):
|
||||
return Response(e, status=status.HTTP_204_NO_CONTENT)
|
||||
|
||||
|
||||
class QuotaLiveStockAgeLimitation(viewsets.ModelViewSet, SoftDeleteMixin):
|
||||
class QuotaLiveStockAgeLimitation(SoftDeleteMixin, viewsets.ModelViewSet):
|
||||
queryset = product_models.QuotaLiveStockAgeLimitation.objects.all() # noqa
|
||||
serializer_class = quota_serializers.QuotaLiveStockAgeLimitationSerializer
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ def delete(queryset, pk):
|
||||
obj.delete()
|
||||
|
||||
|
||||
class QuotaDistributionViewSet(viewsets.ModelViewSet, DynamicSearchMixin, SoftDeleteMixin):
|
||||
class QuotaDistributionViewSet(SoftDeleteMixin, viewsets.ModelViewSet, DynamicSearchMixin):
|
||||
""" quota distribution apis """
|
||||
|
||||
queryset = product_models.QuotaDistribution.objects.all()
|
||||
|
||||
Reference in New Issue
Block a user