mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-31 21:25:42 +00:00 
			
		
		
		
	Allocation by serial number now moved to the API
This commit is contained in:
		| @@ -2357,15 +2357,30 @@ function loadSalesOrderLineItemTable(table, options={}) { | ||||
|         $(table).find('.button-add-by-sn').click(function() { | ||||
|             var pk = $(this).attr('pk'); | ||||
|  | ||||
|             // TODO: Migrate this form to the API forms | ||||
|             inventreeGet(`/api/order/so-line/${pk}/`, {}, | ||||
|                 { | ||||
|                     success: function(response) { | ||||
|                         launchModalForm('{% url "so-assign-serials" %}', { | ||||
|                             success: reloadTable, | ||||
|                             data: { | ||||
|                                 line: pk, | ||||
|                                 part: response.part,  | ||||
|  | ||||
|                         constructForm(`/api/order/so/${options.order}/allocate-serials/`, { | ||||
|                             method: 'POST', | ||||
|                             title: '{% trans "Allocate Serial Numbers" %}', | ||||
|                             fields: { | ||||
|                                 line_item: { | ||||
|                                     value: pk, | ||||
|                                     hidden: true, | ||||
|                                 }, | ||||
|                                 quantity: {}, | ||||
|                                 serial_numbers: {}, | ||||
|                                 shipment: { | ||||
|                                     filters: { | ||||
|                                         order: options.order, | ||||
|                                         shipped: false, | ||||
|                                     }, | ||||
|                                     auto_fill: true, | ||||
|                                 } | ||||
|                             }, | ||||
|                             onSuccess: function() { | ||||
|                                 $(table).bootstrapTable('refresh'); | ||||
|                             } | ||||
|                         }); | ||||
|                     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user