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

Fixes for build output tables

- Only show "completed" builds in the "completed builds" table (should be obvious)
- Display "serial number" appropriately in build output allocation table

(cherry picked from commit a3ba33cae884b06e1af0d60b88ea3f725734e96b)
This commit is contained in:
Oliver 2021-10-05 12:32:54 +11:00
parent 10e3a5f5a9
commit 1132b6c51a
3 changed files with 11 additions and 2 deletions

View File

@ -292,6 +292,7 @@ loadStockTable($("#build-stock-table"), {
location_detail: true, location_detail: true,
part_detail: true, part_detail: true,
build: {{ build.id }}, build: {{ build.id }},
is_building: false,
}, },
groupByField: 'location', groupByField: 'location',
buttons: [ buttons: [

View File

@ -64,6 +64,7 @@ class StockItemSerializerBrief(InvenTreeModelSerializer):
'location', 'location',
'location_name', 'location_name',
'quantity', 'quantity',
'serial',
] ]

View File

@ -623,8 +623,15 @@ function loadBuildOutputAllocationTable(buildInfo, output, options={}) {
var url = ''; var url = '';
if (row.serial && row.quantity == 1) {
text = `{% trans "Serial Number" %}: ${row.serial}`; var serial = row.serial;
if (row.stock_item_detail) {
serial = row.stock_item_detail.serial;
}
if (serial && row.quantity == 1) {
text = `{% trans "Serial Number" %}: ${serial}`;
} else { } else {
text = `{% trans "Quantity" %}: ${row.quantity}`; text = `{% trans "Quantity" %}: ${row.quantity}`;
} }