From 05ce17f8df290b13b8a514f705840f65150c6cb0 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Thu, 29 Oct 2020 09:45:42 +1100 Subject: [PATCH] Tweaks --- InvenTree/build/templates/build/unallocate.html | 7 ++++++- InvenTree/build/views.py | 4 +++- InvenTree/templates/js/build.js | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/InvenTree/build/templates/build/unallocate.html b/InvenTree/build/templates/build/unallocate.html index f6543b3732..a650e95718 100644 --- a/InvenTree/build/templates/build/unallocate.html +++ b/InvenTree/build/templates/build/unallocate.html @@ -5,6 +5,11 @@ {{ block.super }} -{% trans "Are you sure you wish to unallocate all stock for this build?" %} + +
+ {% trans "Are you sure you wish to unallocate all stock for this build?" %} +
+ {% trans "All incomplete stock allocations will be removed from the build" %} +
{% endblock %} \ No newline at end of file diff --git a/InvenTree/build/views.py b/InvenTree/build/views.py index 46bdc0ceaa..c46d4e0cf3 100644 --- a/InvenTree/build/views.py +++ b/InvenTree/build/views.py @@ -887,10 +887,12 @@ class BuildItemEdit(AjaxUpdateView): form = super(BuildItemEdit, self).get_form() # Hide fields which we do not wish the user to edit - for field in ['build', 'stock_item', 'install_into']: + for field in ['build', 'stock_item']: if form[field].value(): form.fields[field].widget = HiddenInput() + form.fields['install_into'].widget = HiddenInput() + return form diff --git a/InvenTree/templates/js/build.js b/InvenTree/templates/js/build.js index 598c818113..36f21e2245 100644 --- a/InvenTree/templates/js/build.js +++ b/InvenTree/templates/js/build.js @@ -568,8 +568,8 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { var progressA = parseFloat(aA) / qA; var progressB = parseFloat(aB) / qB; - // Handle the case where both are at 100% - if (progressA == 1.0 && progressB == 1.0) { + // Handle the case where both ratios are equal + if (progressA == progressB) { return (qA < qB) ? 1 : -1; }