2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-05 13:10:57 +00:00

Convert StockItemEditStatus to use API forms

This commit is contained in:
Oliver
2021-06-30 08:52:53 +10:00
parent 43f26f2c65
commit 7d53bcb27c
3 changed files with 8 additions and 29 deletions

View File

@ -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