mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 20:55:42 +00:00 
			
		
		
		
	Provide initial data
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user