mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-14 19:15:41 +00:00
Implemented tree view
Using library bootstrap-treeview - part category tree - stock location tree - Currenly is functional but looks terrible
This commit is contained in:
@ -3,11 +3,20 @@ from django_filters import NumberFilter
|
||||
|
||||
from rest_framework import generics, permissions, response
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
# from InvenTree.models import FilterChildren
|
||||
from .models import StockLocation, StockItem
|
||||
from .serializers import StockItemSerializer, StockQuantitySerializer
|
||||
from .serializers import LocationSerializer
|
||||
|
||||
from InvenTree.views import TreeSerializer
|
||||
|
||||
|
||||
class StockCategoryTree(TreeSerializer):
|
||||
title = 'Stock'
|
||||
model = StockLocation
|
||||
|
||||
|
||||
class StockDetail(generics.RetrieveUpdateDestroyAPIView):
|
||||
"""
|
||||
@ -127,3 +136,8 @@ class LocationList(generics.ListCreateAPIView):
|
||||
permission_classes = (permissions.IsAuthenticatedOrReadOnly,)
|
||||
filter_backends = (DjangoFilterBackend,)
|
||||
filter_class = StockLocationFilter
|
||||
|
||||
|
||||
stock_api_urls = [
|
||||
url(r'^tree/?', StockCategoryTree.as_view(), name='api-stock-tree'),
|
||||
]
|
Reference in New Issue
Block a user