mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	Fixes for "duplicate stock item" form
- Redirect to the new stock item - Display a success message
This commit is contained in:
		| @@ -294,7 +294,17 @@ function stockItemGroups(options={}) { | ||||
|  */ | ||||
| function duplicateStockItem(pk, options) { | ||||
|  | ||||
|     // First, we need the StockItem informatino | ||||
|     // If no "success" function provided, add a default | ||||
|     if (!options.onSuccess) { | ||||
|         options.onSuccess = function(response) { | ||||
|  | ||||
|             showAlertOrCache('{% trans "Stock item duplicated" %}', true, {style: 'success'}); | ||||
|  | ||||
|             window.location.href = `/stock/item/${response.pk}/`; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     // First, we need the StockItem information | ||||
|     inventreeGet(`/api/stock/${pk}/`, {}, { | ||||
|         success: function(data) { | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user