2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-05 21:20:56 +00:00

Add ability to move a stock item

This commit is contained in:
Oliver
2018-04-30 01:00:18 +10:00
parent bee760d184
commit d68b51e007
5 changed files with 48 additions and 4 deletions

View File

@ -11,8 +11,9 @@ from part.models import Part
from .models import StockItem, StockLocation
from .forms import EditStockLocationForm
from .forms import CreateStockItemForm
from .forms import EditStockItemForm
from .forms import MoveStockItemForm
class StockIndex(ListView):
model = StockItem
@ -84,7 +85,7 @@ class StockLocationCreate(AjaxCreateView):
class StockItemCreate(AjaxCreateView):
model = StockItem
form_class = EditStockItemForm
form_class = CreateStockItemForm
template_name = 'stock/item_create.html'
context_object_name = 'item'
ajax_template_name = 'modal_form.html'
@ -123,3 +124,14 @@ class StockItemDelete(AjaxDeleteView):
template_name = 'stock/item_delete.html'
context_object_name = 'item'
ajax_form_title = 'Delete Stock Item'
class StockItemMove(AjaxUpdateView):
model = StockItem
template_name = 'modal_form.html'
context_object_name = 'item'
ajax_form_title = 'Move Stock Item'
ajax_submit_text = 'Move'
form_class = MoveStockItemForm