2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

update depreciated paths

This commit is contained in:
Matthias
2022-05-01 22:00:18 +02:00
parent d05472b30c
commit 67ab45bdee
19 changed files with 370 additions and 372 deletions

View File

@ -9,7 +9,7 @@ from collections import OrderedDict
from datetime import datetime, timedelta
from django.core.exceptions import ValidationError as DjangoValidationError
from django.conf.urls import url, include
from django.urls import include, path, re_path
from django.http import JsonResponse
from django.db.models import Q, F
from django.db import transaction
@ -1383,47 +1383,47 @@ class LocationDetail(generics.RetrieveUpdateDestroyAPIView):
stock_api_urls = [
url(r'^location/', include([
re_path(r'^location/', include([
url(r'^tree/', StockLocationTree.as_view(), name='api-location-tree'),
re_path(r'^tree/', StockLocationTree.as_view(), name='api-location-tree'),
url(r'^(?P<pk>\d+)/', LocationDetail.as_view(), name='api-location-detail'),
url(r'^.*$', StockLocationList.as_view(), name='api-location-list'),
re_path(r'^(?P<pk>\d+)/', LocationDetail.as_view(), name='api-location-detail'),
re_path(r'^.*$', StockLocationList.as_view(), name='api-location-list'),
])),
# Endpoints for bulk stock adjustment actions
url(r'^count/', StockCount.as_view(), name='api-stock-count'),
url(r'^add/', StockAdd.as_view(), name='api-stock-add'),
url(r'^remove/', StockRemove.as_view(), name='api-stock-remove'),
url(r'^transfer/', StockTransfer.as_view(), name='api-stock-transfer'),
url(r'^assign/', StockAssign.as_view(), name='api-stock-assign'),
url(r'^merge/', StockMerge.as_view(), name='api-stock-merge'),
re_path(r'^count/', StockCount.as_view(), name='api-stock-count'),
re_path(r'^add/', StockAdd.as_view(), name='api-stock-add'),
re_path(r'^remove/', StockRemove.as_view(), name='api-stock-remove'),
re_path(r'^transfer/', StockTransfer.as_view(), name='api-stock-transfer'),
re_path(r'^assign/', StockAssign.as_view(), name='api-stock-assign'),
re_path(r'^merge/', StockMerge.as_view(), name='api-stock-merge'),
# StockItemAttachment API endpoints
url(r'^attachment/', include([
url(r'^(?P<pk>\d+)/', StockAttachmentDetail.as_view(), name='api-stock-attachment-detail'),
url(r'^$', StockAttachmentList.as_view(), name='api-stock-attachment-list'),
re_path(r'^attachment/', include([
re_path(r'^(?P<pk>\d+)/', StockAttachmentDetail.as_view(), name='api-stock-attachment-detail'),
path('', StockAttachmentList.as_view(), name='api-stock-attachment-list'),
])),
# StockItemTestResult API endpoints
url(r'^test/', include([
url(r'^(?P<pk>\d+)/', StockItemTestResultDetail.as_view(), name='api-stock-test-result-detail'),
url(r'^.*$', StockItemTestResultList.as_view(), name='api-stock-test-result-list'),
re_path(r'^test/', include([
re_path(r'^(?P<pk>\d+)/', StockItemTestResultDetail.as_view(), name='api-stock-test-result-detail'),
re_path(r'^.*$', StockItemTestResultList.as_view(), name='api-stock-test-result-list'),
])),
# StockItemTracking API endpoints
url(r'^track/', include([
url(r'^(?P<pk>\d+)/', StockTrackingDetail.as_view(), name='api-stock-tracking-detail'),
url(r'^.*$', StockTrackingList.as_view(), name='api-stock-tracking-list'),
re_path(r'^track/', include([
re_path(r'^(?P<pk>\d+)/', StockTrackingDetail.as_view(), name='api-stock-tracking-detail'),
re_path(r'^.*$', StockTrackingList.as_view(), name='api-stock-tracking-list'),
])),
# Detail views for a single stock item
url(r'^(?P<pk>\d+)/', include([
url(r'^serialize/', StockItemSerialize.as_view(), name='api-stock-item-serialize'),
url(r'^install/', StockItemInstall.as_view(), name='api-stock-item-install'),
url(r'^.*$', StockDetail.as_view(), name='api-stock-detail'),
re_path(r'^(?P<pk>\d+)/', include([
re_path(r'^serialize/', StockItemSerialize.as_view(), name='api-stock-item-serialize'),
re_path(r'^install/', StockItemInstall.as_view(), name='api-stock-item-install'),
re_path(r'^.*$', StockDetail.as_view(), name='api-stock-detail'),
])),
# Anything else
url(r'^.*$', StockList.as_view(), name='api-stock-list'),
re_path(r'^.*$', StockList.as_view(), name='api-stock-list'),
]

View File

@ -2,55 +2,55 @@
URL lookup for Stock app
"""
from django.conf.urls import url, include
from django.urls import include, re_path
from stock import views
location_urls = [
url(r'^(?P<pk>\d+)/', include([
url(r'^delete/?', views.StockLocationDelete.as_view(), name='stock-location-delete'),
url(r'^qr_code/?', views.StockLocationQRCode.as_view(), name='stock-location-qr'),
re_path(r'^(?P<pk>\d+)/', include([
re_path(r'^delete/?', views.StockLocationDelete.as_view(), name='stock-location-delete'),
re_path(r'^qr_code/?', views.StockLocationQRCode.as_view(), name='stock-location-qr'),
# Anything else
url('^.*$', views.StockLocationDetail.as_view(), name='stock-location-detail'),
re_path('^.*$', views.StockLocationDetail.as_view(), name='stock-location-detail'),
])),
]
stock_item_detail_urls = [
url(r'^convert/', views.StockItemConvert.as_view(), name='stock-item-convert'),
url(r'^delete/', views.StockItemDelete.as_view(), name='stock-item-delete'),
url(r'^qr_code/', views.StockItemQRCode.as_view(), name='stock-item-qr'),
url(r'^delete_test_data/', views.StockItemDeleteTestData.as_view(), name='stock-item-delete-test-data'),
url(r'^return/', views.StockItemReturnToStock.as_view(), name='stock-item-return'),
re_path(r'^convert/', views.StockItemConvert.as_view(), name='stock-item-convert'),
re_path(r'^delete/', views.StockItemDelete.as_view(), name='stock-item-delete'),
re_path(r'^qr_code/', views.StockItemQRCode.as_view(), name='stock-item-qr'),
re_path(r'^delete_test_data/', views.StockItemDeleteTestData.as_view(), name='stock-item-delete-test-data'),
re_path(r'^return/', views.StockItemReturnToStock.as_view(), name='stock-item-return'),
url(r'^add_tracking/', views.StockItemTrackingCreate.as_view(), name='stock-tracking-create'),
re_path(r'^add_tracking/', views.StockItemTrackingCreate.as_view(), name='stock-tracking-create'),
url('^.*$', views.StockItemDetail.as_view(), name='stock-item-detail'),
re_path('^.*$', views.StockItemDetail.as_view(), name='stock-item-detail'),
]
stock_tracking_urls = [
# edit
url(r'^(?P<pk>\d+)/edit/', views.StockItemTrackingEdit.as_view(), name='stock-tracking-edit'),
re_path(r'^(?P<pk>\d+)/edit/', views.StockItemTrackingEdit.as_view(), name='stock-tracking-edit'),
# delete
url(r'^(?P<pk>\d+)/delete', views.StockItemTrackingDelete.as_view(), name='stock-tracking-delete'),
re_path(r'^(?P<pk>\d+)/delete', views.StockItemTrackingDelete.as_view(), name='stock-tracking-delete'),
]
stock_urls = [
# Stock location
url(r'^location/', include(location_urls)),
re_path(r'^location/', include(location_urls)),
url(r'^item/uninstall/', views.StockItemUninstall.as_view(), name='stock-item-uninstall'),
re_path(r'^item/uninstall/', views.StockItemUninstall.as_view(), name='stock-item-uninstall'),
url(r'^track/', include(stock_tracking_urls)),
re_path(r'^track/', include(stock_tracking_urls)),
# Individual stock items
url(r'^item/(?P<pk>\d+)/', include(stock_item_detail_urls)),
re_path(r'^item/(?P<pk>\d+)/', include(stock_item_detail_urls)),
url(r'^sublocations/', views.StockIndex.as_view(template_name='stock/sublocation.html'), name='stock-sublocations'),
re_path(r'^sublocations/', views.StockIndex.as_view(template_name='stock/sublocation.html'), name='stock-sublocations'),
url(r'^.*$', views.StockIndex.as_view(), name='stock-index'),
re_path(r'^.*$', views.StockIndex.as_view(), name='stock-index'),
]