mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Provide initial data
This commit is contained in:
parent
7575a39b7f
commit
6c5b09efd4
@ -462,13 +462,25 @@ class StockLocationCreate(AjaxCreateView):
|
||||
return initials
|
||||
|
||||
|
||||
class StockItemSerialize(AjaxView, FormMixin):
|
||||
class StockItemSerialize(AjaxUpdateView):
|
||||
""" View for manually serializing a StockItem """
|
||||
|
||||
model = StockItem
|
||||
ajax_template_name = 'stock/item_serialize.html'
|
||||
ajax_form_title = 'Serialize Stock'
|
||||
form_class = SerializeStockForm
|
||||
|
||||
def get_initial(self):
|
||||
|
||||
initials = super().get_initial().copy()
|
||||
|
||||
item = self.get_object()
|
||||
|
||||
initials['quantity'] = item.quantity
|
||||
initials['destination'] = item.location.pk
|
||||
|
||||
return initials
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
|
||||
return super().get(request, *args, **kwargs)
|
||||
|
Loading…
Reference in New Issue
Block a user