From a4d067fbe233c7eaf83dbf9b9b3c69f30a31fae1 Mon Sep 17 00:00:00 2001 From: Alonso Lopez Date: Wed, 24 Jun 2026 05:24:19 +0000 Subject: [PATCH] fix: Show badges for flagged stock items --- src/frontend/src/components/render/Stock.tsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/frontend/src/components/render/Stock.tsx b/src/frontend/src/components/render/Stock.tsx index 1ecd89809b..ce31fa6d54 100644 --- a/src/frontend/src/components/render/Stock.tsx +++ b/src/frontend/src/components/render/Stock.tsx @@ -13,6 +13,7 @@ import { type InstanceRenderInterface, RenderInlineModel } from './Instance'; +import { StatusRenderer, getStatusCodes } from './StatusRenderer'; /** * Inline rendering of a single StockLocation instance @@ -107,6 +108,17 @@ export function RenderStockItem( const showLocation: boolean = props.extra?.show_location !== false; const location: any = props.instance?.location_detail; + // Only flag the built-in "Attention needed" and "Damaged" stock statuses (#10769) + const statusKey = instance?.status_custom_key ?? instance?.status; + const flaggedStatusNames = ['ATTENTION', 'DAMAGED']; + const statusCodes = getStatusCodes(ModelType.stockitem); + const showStatus = + !!statusCodes && + Object.values(statusCodes.values).some( + (entry) => + entry.key == statusKey && flaggedStatusNames.includes(entry.name) + ); + // Form the "secondary" text to display const secondary: ReactNode = ( @@ -116,6 +128,9 @@ export function RenderStockItem( {instance.batch && ( )} + {showStatus && ( + + )} );