diff --git a/InvenTree/stock/templates/stock/item_base.html b/InvenTree/stock/templates/stock/item_base.html index bf9d10590f..b674c5c7fc 100644 --- a/InvenTree/stock/templates/stock/item_base.html +++ b/InvenTree/stock/templates/stock/item_base.html @@ -490,13 +490,14 @@ $("#stock-edit").click(function () { }); $('#stock-edit-status').click(function () { - launchModalForm( - "{% url 'stock-item-edit-status' item.id %}", - { - reload: true, - submit_text: '{% trans "Save" %}', - } - ); + + constructForm('{% url "api-stock-detail" item.pk %}', { + fields: { + status: {}, + }, + reload: true, + title: '{% trans "Edit Stock Status" %}', + }); }); {% endif %} diff --git a/InvenTree/stock/urls.py b/InvenTree/stock/urls.py index dbdbdda317..c0b6341744 100644 --- a/InvenTree/stock/urls.py +++ b/InvenTree/stock/urls.py @@ -24,7 +24,6 @@ location_urls = [ ] stock_item_detail_urls = [ - url(r'^edit_status/', views.StockItemEditStatus.as_view(), name='stock-item-edit-status'), url(r'^edit/', views.StockItemEdit.as_view(), name='stock-item-edit'), url(r'^convert/', views.StockItemConvert.as_view(), name='stock-item-convert'), url(r'^serialize/', views.StockItemSerialize.as_view(), name='stock-item-serialize'), diff --git a/InvenTree/stock/views.py b/InvenTree/stock/views.py index 9a47576442..bc3e8cb462 100644 --- a/InvenTree/stock/views.py +++ b/InvenTree/stock/views.py @@ -1212,27 +1212,6 @@ class StockAdjust(AjaxView, FormMixin): return _("Deleted {n} stock items").format(n=count) -class StockItemEditStatus(AjaxUpdateView): - """ - View for editing stock item status field - """ - - model = StockItem - form_class = StockForms.EditStockItemStatusForm - ajax_form_title = _('Edit Stock Item Status') - - def save(self, object, form, **kwargs): - """ - Override the save method, to track the user who updated the model - """ - - item = form.save(commit=False) - - item.save(user=self.request.user) - - return item - - class StockItemEdit(AjaxUpdateView): """ View for editing details of a single StockItem