InvenTree/InvenTree/stock/urls.py
Oliver 8b464e4397
Migrate "Convert to Variant" form to the API (#3183)
* Adds a Part API filter to limit query to valid conversion options for the specified part

* Refactor 'exclude_tree' filter to use django-filter framework

* Refactor the 'ancestor' filter

* Refactoring more API filtering fields:

- variant_of
- in_bom_for

* Adds API endpoint / view / serializer for converting a StockItem to variant

* stock item conversion now perfomed via the API

* Bump API version

* Add unit tests for new filtering option on the Part list API endpoint

* Adds  unit test for "convert" API endpoint functionality
2022-06-12 16:06:11 +10:00

35 lines
965 B
Python

"""URL lookup for Stock app."""
from django.urls import include, re_path
from stock import views
location_urls = [
re_path(r'^(?P<pk>\d+)/', include([
re_path(r'^qr_code/?', views.StockLocationQRCode.as_view(), name='stock-location-qr'),
# Anything else - direct to the location detail view
re_path('^.*$', views.StockLocationDetail.as_view(), name='stock-location-detail'),
])),
]
stock_item_detail_urls = [
re_path(r'^qr_code/', views.StockItemQRCode.as_view(), name='stock-item-qr'),
# Anything else - direct to the item detail view
re_path('^.*$', views.StockItemDetail.as_view(), name='stock-item-detail'),
]
stock_urls = [
# Stock location
re_path(r'^location/', include(location_urls)),
# Individual stock items
re_path(r'^item/(?P<pk>\d+)/', include(stock_item_detail_urls)),
# Default to the stock index page
re_path(r'^.*$', views.StockIndex.as_view(), name='stock-index'),
]