From 802ff35cf354e516ece90785e2b7b711b93a5da1 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Sun, 2 Jun 2019 12:45:44 +1000 Subject: [PATCH] Remove some now unused forms / views / etc --- InvenTree/stock/api.py | 6 +- InvenTree/stock/forms.py | 32 +++------- InvenTree/stock/templates/stock/item.html | 41 ++++++------- InvenTree/stock/urls.py | 2 - InvenTree/stock/views.py | 73 ----------------------- 5 files changed, 30 insertions(+), 124 deletions(-) diff --git a/InvenTree/stock/api.py b/InvenTree/stock/api.py index 7fa88a646f..c1c2b8e1cf 100644 --- a/InvenTree/stock/api.py +++ b/InvenTree/stock/api.py @@ -470,9 +470,9 @@ stock_api_urls = [ url(r'location/(?P\d+)/', include(location_endpoints)), - url(r'stocktake/?', StockStocktake.as_view(), name='api-stock-stocktake'), - - url(r'move/?', StockMove.as_view(), name='api-stock-move'), + # These JSON endpoints have been replaced (for now) with server-side form rendering - 02/06/2019 + # url(r'stocktake/?', StockStocktake.as_view(), name='api-stock-stocktake'), + # url(r'move/?', StockMove.as_view(), name='api-stock-move'), url(r'track/?', StockTrackingList.as_view(), name='api-stock-track'), diff --git a/InvenTree/stock/forms.py b/InvenTree/stock/forms.py index 6304ba2e60..ef55356961 100644 --- a/InvenTree/stock/forms.py +++ b/InvenTree/stock/forms.py @@ -42,20 +42,16 @@ class CreateStockItemForm(HelperForm): ] -class MoveStockItemForm(HelperForm): - """ Form for moving a StockItem to a new location """ - - note = forms.CharField(label='Notes', required=True, help_text='Add note (required)') - - class Meta: - model = StockItem - - fields = [ - 'location', - 'note' - ] - class AdjustStockForm(forms.ModelForm): + """ Form for performing simple stock adjustments. + + - Add stock + - Remove stock + - Count stock + - Move stock + + This form is used for managing stock adjuments for single or multiple stock items. + """ def get_location_choices(self): locs = StockLocation.objects.all() @@ -88,16 +84,6 @@ class AdjustStockForm(forms.ModelForm): ] -class StocktakeForm(forms.ModelForm): - - class Meta: - model = StockItem - - fields = [ - 'quantity', - ] - - class EditStockItemForm(HelperForm): """ Form for editing a StockItem object. Note that not all fields can be edited here (even if they can be specified during creation. diff --git a/InvenTree/stock/templates/stock/item.html b/InvenTree/stock/templates/stock/item.html index cb54ac6f5e..40d78eb7e1 100644 --- a/InvenTree/stock/templates/stock/item.html +++ b/InvenTree/stock/templates/stock/item.html @@ -22,11 +22,13 @@