mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Display "loading" until allocations loaded
This commit is contained in:
		@@ -19,6 +19,7 @@ Increment this API version number whenever there is a significant change to the
 | 
			
		||||
 | 
			
		||||
v30 -> 2022-03-09
 | 
			
		||||
    - Adds "exclude_location" field to BuildAutoAllocation API endpoint
 | 
			
		||||
    - Allows BuildItem API endpoint to be filtered by BomItem relation
 | 
			
		||||
 | 
			
		||||
v29 -> 2022-03-08
 | 
			
		||||
    - Adds "scheduling" endpoint for predicted stock scheduling information
 | 
			
		||||
 
 | 
			
		||||
@@ -461,6 +461,7 @@ class BuildItemList(generics.ListCreateAPIView):
 | 
			
		||||
    filter_fields = [
 | 
			
		||||
        'build',
 | 
			
		||||
        'stock_item',
 | 
			
		||||
        'bom_item',
 | 
			
		||||
        'install_into',
 | 
			
		||||
    ]
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1219,6 +1219,18 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
 | 
			
		||||
                            $(table).bootstrapTable('updateByUniqueId', key, tableRow, true);
 | 
			
		||||
                        }
 | 
			
		||||
 | 
			
		||||
                        // Update any rows which we did not receive allocation information for
 | 
			
		||||
                        var td = $(table).bootstrapTable('getData');
 | 
			
		||||
 | 
			
		||||
                        td.forEach(function(tableRow) {
 | 
			
		||||
                            if (tableRow.allocations == null) {
 | 
			
		||||
 | 
			
		||||
                                tableRow.allocations = [];
 | 
			
		||||
 | 
			
		||||
                                $(table).bootstrapTable('updateByUniqueId', tableRow.pk, tableRow, true);
 | 
			
		||||
                            }
 | 
			
		||||
                        });
 | 
			
		||||
 | 
			
		||||
                        // Update the progress bar for this build output
 | 
			
		||||
                        var build_progress = $(`#output-progress-${outputId}`);
 | 
			
		||||
 | 
			
		||||
@@ -1419,15 +1431,17 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
 | 
			
		||||
                formatter: function(value, row) {
 | 
			
		||||
                    var allocated = 0;
 | 
			
		||||
 | 
			
		||||
                    if (row.allocations) {
 | 
			
		||||
                    if (row.allocations != null) {
 | 
			
		||||
                        row.allocations.forEach(function(item) {
 | 
			
		||||
                            allocated += item.quantity;
 | 
			
		||||
                        });
 | 
			
		||||
 | 
			
		||||
                        var required = requiredQuantity(row);
 | 
			
		||||
 | 
			
		||||
                        return makeProgressBar(allocated, required);
 | 
			
		||||
                    } else {
 | 
			
		||||
                        return `<em>{% trans "Loading" %}</em>`;
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    var required = requiredQuantity(row);
 | 
			
		||||
 | 
			
		||||
                    return makeProgressBar(allocated, required);
 | 
			
		||||
                },
 | 
			
		||||
                sorter: function(valA, valB, rowA, rowB) {
 | 
			
		||||
                    // Custom sorting function for progress bars
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user