From d2a35c4dba5859121e18c6cef101262d48c4b2b3 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 18 Nov 2026 12:07:14 +1100 Subject: [PATCH] Build fix (#924) * Fix for build detail widget - Display allocated item count - Closes https://github.com/inventree/inventree-app/issues/922 * Add release note entry --- assets/release_notes.md | 5 +++++ lib/widget/build/build_detail.dart | 14 +++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/assets/release_notes.md b/assets/release_notes.md index 3cf5d465..ae4dadd5 100644 --- a/assets/release_notes.md +++ b/assets/release_notes.md @@ -1,3 +1,8 @@ +### 1.1.1 - November 2026 +--- + +- Fix incorrect allocation count in build detail widget + ### 1.1.0 - November 2026 --- diff --git a/lib/widget/build/build_detail.dart b/lib/widget/build/build_detail.dart index 6e852770..04e3c711 100644 --- a/lib/widget/build/build_detail.dart +++ b/lib/widget/build/build_detail.dart @@ -37,6 +37,7 @@ class _BuildOrderDetailState extends RefreshableState { // Track state of the build order int allocatedLineCount = 0; + int allocatedItemCount = 0; int totalLineCount = 0; int outputCount = 0; int attachmentCount = 0; @@ -302,6 +303,17 @@ class _BuildOrderDetailState extends RefreshableState { return; } + // Count the stock items allocated against this build order + InvenTreeBuildItem() + .count(filters: {"build": widget.order.pk.toString()}) + .then((int n) { + if (mounted) { + setState(() { + allocatedItemCount = n; + }); + } + }); + if (widget.order.sourceLocationId != null) { InvenTreeStockLocation().get(widget.order.sourceLocationId!).then(( value, @@ -473,7 +485,7 @@ class _BuildOrderDetailState extends RefreshableState { ListTile( title: Text(L10().allocatedStock), leading: Icon(TablerIcons.box_model_2, color: COLOR_ACTION), - trailing: LinkIcon(text: widget.order.outputCount.toString()), + trailing: LinkIcon(text: allocatedItemCount.toString()), onTap: () => { Navigator.push( context,