2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-17 04:25:42 +00:00

Implement a generic API endpoint for enumeration of status codes (#4543)

* Implement a generic API endpoint for enumeration of status codes

* Adds endpoint for PurchaseOrderStatus

* Add more endpoints (sales order / return orer)

* Add endpoints for StockStatus and StockTrackingCode

* Support build status

* Use the attribute name as the dict key

* Refactored status codes in javascript

- Now accessible by "name" (instead of integer key)
- Will make javascript code much more readable

* Bump API version
This commit is contained in:
Oliver
2023-03-31 07:27:24 +11:00
committed by GitHub
parent f4f7803e96
commit 327ecf2156
9 changed files with 189 additions and 61 deletions

View File

@ -10,7 +10,7 @@ from rest_framework.exceptions import ValidationError
from django_filters.rest_framework import DjangoFilterBackend
from django_filters import rest_framework as rest_filters
from InvenTree.api import AttachmentMixin, APIDownloadMixin, ListCreateDestroyAPIView
from InvenTree.api import AttachmentMixin, APIDownloadMixin, ListCreateDestroyAPIView, StatusView
from InvenTree.helpers import str2bool, isNull, DownloadFile
from InvenTree.filters import InvenTreeOrderingFilter
from InvenTree.status_codes import BuildStatus
@ -536,6 +536,9 @@ build_api_urls = [
re_path(r'^.*$', BuildDetail.as_view(), name='api-build-detail'),
])),
# Build order status code information
re_path(r'status/', StatusView.as_view(), {StatusView.MODEL_REF: BuildStatus}, name='api-build-status-codes'),
# Build List
re_path(r'^.*$', BuildList.as_view(), name='api-build-list'),
]