mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Hide some buttons if row is fully allocated already
This commit is contained in:
parent
42c1210fba
commit
c63a09330f
@ -504,15 +504,17 @@ function loadBuildOutputAllocationTable(buildId, partId, output, options={}) {
|
|||||||
// Generate action buttons for this build output
|
// Generate action buttons for this build output
|
||||||
var html = `<div class='btn-group float-right' role='group'>`;
|
var html = `<div class='btn-group float-right' role='group'>`;
|
||||||
|
|
||||||
if (row.sub_part_detail.assembly) {
|
if (sumAllocations(row) < requiredQuantity(row)) {
|
||||||
html += makeIconButton('fa-tools icon-blue', 'button-build', row.sub_part, '{% trans "Build stock" %}');
|
if (row.sub_part_detail.assembly) {
|
||||||
}
|
html += makeIconButton('fa-tools icon-blue', 'button-build', row.sub_part, '{% trans "Build stock" %}');
|
||||||
|
}
|
||||||
|
|
||||||
if (row.sub_part_detail.purchaseable) {
|
if (row.sub_part_detail.purchaseable) {
|
||||||
html += makeIconButton('fa-shopping-cart icon-blue', 'button-buy', row.sub_part, '{% trans "Order stock" %}', {disabled: true});
|
html += makeIconButton('fa-shopping-cart icon-blue', 'button-buy', row.sub_part, '{% trans "Order stock" %}', {disabled: true});
|
||||||
}
|
}
|
||||||
|
|
||||||
html += makeIconButton('fa-sign-in-alt icon-green', 'button-add', row.sub_part, '{% trans "Allocate stock" %}');
|
html += makeIconButton('fa-sign-in-alt icon-green', 'button-add', row.sub_part, '{% trans "Allocate stock" %}');
|
||||||
|
}
|
||||||
|
|
||||||
html += makeIconButton('fa-times-circle icon-red', 'button-unallocate', row.sub_part, '{% trans "Unallocate stock" %}');
|
html += makeIconButton('fa-times-circle icon-red', 'button-unallocate', row.sub_part, '{% trans "Unallocate stock" %}');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user