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
This commit is contained in:
Oliver authored and GitHub committed 2026-11-18 12:07:14 +11:00
1 parent bfddb02cfb
commit d2a35c4dba
2 files changed
+18 -1

No files matched your search

+5
View File
@@ -1,3 +1,8 @@
### 1.1.1 - November 2026
---
- Fix incorrect allocation count in build detail widget
### 1.1.0 - November 2026
---
+13 -1
View File
@@ -37,6 +37,7 @@ class _BuildOrderDetailState extends RefreshableState<BuildOrderDetailWidget> {
// 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<BuildOrderDetailWidget> {
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<BuildOrderDetailWidget> {
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,