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 %}
|
{% 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 %}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -574,13 +574,29 @@ 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
|
||||||
|
var subtable = $(`#output-sub-table-${pk}`);
|
||||||
|
|
||||||
/*
|
if (subtable.exists()) {
|
||||||
allocateStockToBuild(
|
var rows = subtable.bootstrapTable('getSelections');
|
||||||
build_info.pk,
|
|
||||||
build_info.part,
|
|
||||||
|
|
||||||
)*/
|
// 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;
|
||||||
|
Loading…
Reference in New Issue
Block a user