From 06a3899325d9981672f2dc3c33d326897ed1a7f5 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 27 Oct 2020 09:26:16 +1100 Subject: [PATCH] Disable "unallocate" button if there are not any allocations --- InvenTree/templates/js/build.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/InvenTree/templates/js/build.js b/InvenTree/templates/js/build.js index 449f36e1c6..b2b0599ed8 100644 --- a/InvenTree/templates/js/build.js +++ b/InvenTree/templates/js/build.js @@ -576,7 +576,13 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { 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-minus-circle icon-red', 'button-unallocate', row.sub_part, + '{% trans "Unallocate stock" %}', + { + disabled: row.allocations == null + } + ); html += '';