2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-30 04:26:44 +00:00

Improve dialog message when allocating stock to a build order

This commit is contained in:
Oliver 2022-03-04 17:40:04 +11:00
parent 70c9c9473d
commit d06def3c29

View File

@ -1513,6 +1513,16 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
*/ */
function allocateStockToBuild(build_id, part_id, bom_items, 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) // ID of the associated "build output" (or null)
var output_id = options.output || 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) { if (table_entries.length == 0) {
showAlertDialog( showAlertDialog(
'{% trans "Select Parts" %}', '{% trans "All Parts Allocated" %}',
'{% trans "You must select at least one part to allocate" %}', '{% trans "All selected parts have been fully allocated" %}',
); );
return; return;