deploy list of transactions by search and create_date
This commit is contained in:
@@ -102,9 +102,26 @@ class InventoryQuotaSaleTransactionViewSet(viewsets.ModelViewSet, DynamicSearchM
|
||||
"quota_distribution__distribution_id",
|
||||
"inventory_entry__distribution__distribution_id",
|
||||
"transaction_status",
|
||||
"delivery_address",
|
||||
"product_type",
|
||||
]
|
||||
date_field = "create_date"
|
||||
|
||||
def list(self, request, *args, **kwargs):
|
||||
""" pos transactions list """
|
||||
|
||||
# get device object
|
||||
device = self.get_pos_device()
|
||||
|
||||
queryset = self.queryset.filter(pos_device=device)
|
||||
queryset = self.filter_query(queryset)
|
||||
|
||||
# paginate & response
|
||||
page = self.paginate_queryset(queryset)
|
||||
if page is not None:
|
||||
serializer = self.get_serializer(page, many=True)
|
||||
return self.get_paginated_response(serializer.data)
|
||||
|
||||
@transaction.atomic
|
||||
def create(self, request, *args, **kwargs):
|
||||
""" create transaction with product items """
|
||||
|
||||
Reference in New Issue
Block a user