mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Re-enable the "allocate" stock button
This commit is contained in:
parent
6c1dad8d91
commit
90625af39d
@ -374,7 +374,13 @@ inventreeGet(
|
||||
|
||||
{% if build.active and build.has_untracked_bom_items %}
|
||||
// Load allocation table for un-tracked parts
|
||||
loadBuildOutputAllocationTable(build_info, null);
|
||||
loadBuildOutputAllocationTable(
|
||||
build_info,
|
||||
null,
|
||||
{
|
||||
search: true,
|
||||
}
|
||||
);
|
||||
{% endif %}
|
||||
}
|
||||
}
|
||||
|
@ -575,12 +575,28 @@ function loadBuildOutputTable(build_info, options={}) {
|
||||
// TODO
|
||||
var todo = "Work out which stock items we need to allocate and launch the form";
|
||||
|
||||
/*
|
||||
allocateStockToBuild(
|
||||
build_info.pk,
|
||||
build_info.part,
|
||||
// Find the "allocation" sub-table associated with this output
|
||||
var subtable = $(`#output-sub-table-${pk}`);
|
||||
|
||||
)*/
|
||||
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
|
||||
@ -665,7 +681,6 @@ function loadBuildOutputTable(build_info, options={}) {
|
||||
search: false,
|
||||
sidePagination: 'server',
|
||||
detailView: has_tracked_items,
|
||||
detailViewByClick: true,
|
||||
detailFilter: function(index, row) {
|
||||
return true;
|
||||
},
|
||||
@ -1025,7 +1040,6 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
|
||||
},
|
||||
sortable: true,
|
||||
showColumns: false,
|
||||
detailViewByClick: true,
|
||||
detailView: true,
|
||||
detailFilter: function(index, row) {
|
||||
return row.allocations != null;
|
||||
|
Loading…
Reference in New Issue
Block a user