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

Pass StockItem object through to the SerializeStock form

This commit is contained in:
Oliver Walters
2020-05-15 21:16:00 +10:00
parent 5b5b848a98
commit 72cfaccac5
2 changed files with 26 additions and 2 deletions

View File

@ -755,7 +755,18 @@ class StockItemSerialize(AjaxUpdateView):
model = StockItem
ajax_template_name = 'stock/item_serialize.html'
ajax_form_title = _('Serialize Stock')
form_class = SerializeStockForm
#form_class = SerializeStockForm
def get_form(self):
context = self.get_form_kwargs()
# Pass the StockItem object through to the form
context['item'] = self.get_object()
form = SerializeStockForm(**context)
return form
def get_initial(self):