mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Re-enable the "allocate" stock button
This commit is contained in:
		@@ -374,7 +374,13 @@ inventreeGet(
 | 
				
			|||||||
        
 | 
					        
 | 
				
			||||||
            {% if build.active and build.has_untracked_bom_items %}
 | 
					            {% if build.active and build.has_untracked_bom_items %}
 | 
				
			||||||
            // Load allocation table for un-tracked parts
 | 
					            // Load allocation table for un-tracked parts
 | 
				
			||||||
            loadBuildOutputAllocationTable(build_info, null);
 | 
					            loadBuildOutputAllocationTable(
 | 
				
			||||||
 | 
					                build_info,
 | 
				
			||||||
 | 
					                null,
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    search: true,
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
            {% endif %}
 | 
					            {% endif %}
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -575,12 +575,28 @@ function loadBuildOutputTable(build_info, options={}) {
 | 
				
			|||||||
            // TODO
 | 
					            // TODO
 | 
				
			||||||
            var todo = "Work out which stock items we need to allocate and launch the form";
 | 
					            var todo = "Work out which stock items we need to allocate and launch the form";
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            /*
 | 
					            // Find the "allocation" sub-table associated with this output
 | 
				
			||||||
            allocateStockToBuild(
 | 
					            var subtable = $(`#output-sub-table-${pk}`);
 | 
				
			||||||
                build_info.pk,
 | 
					 | 
				
			||||||
                build_info.part,
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            )*/
 | 
					            if (subtable.exists()) {
 | 
				
			||||||
 | 
					                var rows = subtable.bootstrapTable('getSelections');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                // None selected? Use all!
 | 
				
			||||||
 | 
					                if (rows.length == 0) {
 | 
				
			||||||
 | 
					                    rows = subtable.bootstrapTable('getData');
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                allocateStockToBuild(
 | 
				
			||||||
 | 
					                    build_info.pk,
 | 
				
			||||||
 | 
					                    build_info.part,
 | 
				
			||||||
 | 
					                    rows,
 | 
				
			||||||
 | 
					                    {
 | 
				
			||||||
 | 
					                        output: pk,
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                );
 | 
				
			||||||
 | 
					            } else {
 | 
				
			||||||
 | 
					                console.log(`WARNING: Could not locate sub-table for output ${pk}`);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Callack for the "unallocate" button
 | 
					        // Callack for the "unallocate" button
 | 
				
			||||||
@@ -665,7 +681,6 @@ function loadBuildOutputTable(build_info, options={}) {
 | 
				
			|||||||
        search: false,
 | 
					        search: false,
 | 
				
			||||||
        sidePagination: 'server',
 | 
					        sidePagination: 'server',
 | 
				
			||||||
        detailView: has_tracked_items,
 | 
					        detailView: has_tracked_items,
 | 
				
			||||||
        detailViewByClick: true,
 | 
					 | 
				
			||||||
        detailFilter: function(index, row) {
 | 
					        detailFilter: function(index, row) {
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
@@ -1025,7 +1040,6 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
 | 
				
			|||||||
        },
 | 
					        },
 | 
				
			||||||
        sortable: true,
 | 
					        sortable: true,
 | 
				
			||||||
        showColumns: false,
 | 
					        showColumns: false,
 | 
				
			||||||
        detailViewByClick: true,
 | 
					 | 
				
			||||||
        detailView: true,
 | 
					        detailView: true,
 | 
				
			||||||
        detailFilter: function(index, row) {
 | 
					        detailFilter: function(index, row) {
 | 
				
			||||||
            return row.allocations != null;
 | 
					            return row.allocations != null;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user