2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +00:00

Delete a build output entirely

TODO: Needs to describe in the confirmation dialog what is going to happen!
This commit is contained in:
Oliver Walters
2020-10-24 00:14:27 +11:00
parent a71a51b848
commit ea7b1b65d6
7 changed files with 130 additions and 12 deletions

View File

@ -52,13 +52,19 @@ function makeBuildOutputActionButtons(output, buildId) {
// Add a button to "auto allocate" against the particular build output
html += makeIconButton(
'fa-clipboard-check icon-blue', 'button-output-auto', outputId,
'{% trans "Allocate stock items to this output" %}'
'{% trans "Allocate stock items to this output" %}',
{
disabled: true,
}
);
if (output.quantity > 1) {
html += makeIconButton(
'fa-random icon-blue', 'button-output-split', outputId,
'{% trans "Split build output into separate items" %}',
{
disabled: true
}
);
}
@ -66,6 +72,9 @@ function makeBuildOutputActionButtons(output, buildId) {
html += makeIconButton(
'fa-tools icon-green', 'button-output-complete', outputId,
'{% trans "Complete build output" %}',
{
disabled: true
}
);
// Add a button to "cancel" the particular build output (unallocate)
@ -116,6 +125,17 @@ function makeBuildOutputActionButtons(output, buildId) {
);
});
$(panel).find(`#button-output-delete-${outputId}`).click(function() {
launchModalForm(
`/build/${buildId}/delete-output/`,
{
reload: true,
data: {
output: outputId
}
}
);
});
}