From d06def3c29a00870d60cb0f80e92df0ba1a26700 Mon Sep 17 00:00:00 2001 From: Oliver Date: Fri, 4 Mar 2022 17:40:04 +1100 Subject: [PATCH] Improve dialog message when allocating stock to a build order --- InvenTree/templates/js/translated/build.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/InvenTree/templates/js/translated/build.js b/InvenTree/templates/js/translated/build.js index fa0b90682e..7d82e9d424 100644 --- a/InvenTree/templates/js/translated/build.js +++ b/InvenTree/templates/js/translated/build.js @@ -1513,6 +1513,16 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) { */ function allocateStockToBuild(build_id, part_id, bom_items, options={}) { + if (bom_items.length == 0) { + + showAlertDialog( + '{% trans "Select Parts" %}', + '{% trans "You must select at least one part to allocate" %}', + ); + + return; + } + // ID of the associated "build output" (or null) var output_id = options.output || null; @@ -1627,8 +1637,8 @@ function allocateStockToBuild(build_id, part_id, bom_items, options={}) { if (table_entries.length == 0) { showAlertDialog( - '{% trans "Select Parts" %}', - '{% trans "You must select at least one part to allocate" %}', + '{% trans "All Parts Allocated" %}', + '{% trans "All selected parts have been fully allocated" %}', ); return;