mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 11:35:41 +00:00
Exposes API endpoints for ReturnOrderReport
This commit is contained in:
@ -9,6 +9,7 @@ Increment this API version number whenever there is a significant change to the
|
|||||||
|
|
||||||
v102 -> 2023-03-14 : https://github.com/inventree/InvenTree/pull/4488
|
v102 -> 2023-03-14 : https://github.com/inventree/InvenTree/pull/4488
|
||||||
- Adds various endpoints for new "ReturnOrder" models
|
- Adds various endpoints for new "ReturnOrder" models
|
||||||
|
- Adds various endpoints for new "ReturnOrderReport" templates
|
||||||
- Exposes API endpoints for "Contact" model
|
- Exposes API endpoints for "Contact" model
|
||||||
|
|
||||||
v101 -> 2023-03-07 : https://github.com/inventree/InvenTree/pull/4462
|
v101 -> 2023-03-07 : https://github.com/inventree/InvenTree/pull/4462
|
||||||
|
@ -20,9 +20,10 @@ from InvenTree.mixins import ListAPI, RetrieveAPI, RetrieveUpdateDestroyAPI
|
|||||||
from stock.models import StockItem, StockItemAttachment
|
from stock.models import StockItem, StockItemAttachment
|
||||||
|
|
||||||
from .models import (BillOfMaterialsReport, BuildReport, PurchaseOrderReport,
|
from .models import (BillOfMaterialsReport, BuildReport, PurchaseOrderReport,
|
||||||
SalesOrderReport, TestReport)
|
ReturnOrderReport, SalesOrderReport, TestReport)
|
||||||
from .serializers import (BOMReportSerializer, BuildReportSerializer,
|
from .serializers import (BOMReportSerializer, BuildReportSerializer,
|
||||||
PurchaseOrderReportSerializer,
|
PurchaseOrderReportSerializer,
|
||||||
|
ReturnOrderReportSerializer,
|
||||||
SalesOrderReportSerializer, TestReportSerializer)
|
SalesOrderReportSerializer, TestReportSerializer)
|
||||||
|
|
||||||
|
|
||||||
@ -410,6 +411,31 @@ class SalesOrderReportPrint(SalesOrderReportMixin, ReportPrintMixin, RetrieveAPI
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ReturnOrderReportMixin(ReportFilterMixin):
|
||||||
|
"""Mixin for the ReturnOrderReport report template"""
|
||||||
|
|
||||||
|
ITEM_MODEL = order.models.ReturnOrder
|
||||||
|
ITEM_KEY = 'order'
|
||||||
|
|
||||||
|
queryset = ReturnOrderReport.objects.all()
|
||||||
|
serializer_class = ReturnOrderReportSerializer
|
||||||
|
|
||||||
|
|
||||||
|
class ReturnOrderReportList(ReturnOrderReportMixin, ReportListView):
|
||||||
|
"""API list endpoint for the ReturnOrderReport model"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ReturnOrderReportDetail(ReturnOrderReportMixin, RetrieveUpdateDestroyAPI):
|
||||||
|
"""API endpoint for a single ReturnOrderReport object"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
class ReturnOrderReportPrint(ReturnOrderReportMixin, ReportPrintMixin, RetrieveAPI):
|
||||||
|
"""API endpoint for printing a ReturnOrderReport object"""
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
report_api_urls = [
|
report_api_urls = [
|
||||||
|
|
||||||
# Purchase order reports
|
# Purchase order reports
|
||||||
@ -435,6 +461,15 @@ report_api_urls = [
|
|||||||
path('', SalesOrderReportList.as_view(), name='api-so-report-list'),
|
path('', SalesOrderReportList.as_view(), name='api-so-report-list'),
|
||||||
])),
|
])),
|
||||||
|
|
||||||
|
# Return order reports
|
||||||
|
re_path(r'return-order/', include([
|
||||||
|
path(r'<int:pk>/', include([
|
||||||
|
path(r'print/', ReturnOrderReportPrint.as_view(), name='api-return-order-report-print'),
|
||||||
|
path('', ReturnOrderReportDetail.as_view(), name='api-return-order-report-detail'),
|
||||||
|
])),
|
||||||
|
path('', ReturnOrderReportList.as_view(), name='api-return-order-report-list'),
|
||||||
|
])),
|
||||||
|
|
||||||
# Build reports
|
# Build reports
|
||||||
re_path(r'build/', include([
|
re_path(r'build/', include([
|
||||||
# Detail views
|
# Detail views
|
||||||
|
Reference in New Issue
Block a user