Fix issue 10769 (#12286)

* fix: Show badges for flagged stock items

* Updated badge logic to only display on build order and sales order

* refactor: Remove unused modelRenderer for RenderStockItem in BuildForms and SalesOrderForms
This commit is contained in:
Alonso Lopez-Valdez
2026-08-18 17:54:58 +10:00
committed by GitHub
parent 34732f0afa
commit 170359d810
@@ -13,6 +13,7 @@ import {
type InstanceRenderInterface,
RenderInlineModel
} from './Instance';
import { StatusRenderer } from './StatusRenderer';
/**
* Inline rendering of a single StockLocation instance
@@ -102,6 +103,8 @@ export function RenderStockItem(
const showLocation: boolean = props.extra?.show_location !== false;
const location: any = props.instance?.location_detail;
const statusKey = instance?.status_custom_key ?? instance?.status;
// Form the "secondary" text to display
const secondary: ReactNode = (
<Group gap='xs' style={{ paddingLeft: '5px' }}>
@@ -111,6 +114,13 @@ export function RenderStockItem(
{instance.batch && (
<InlineSecondaryBadge title={t`Batch`} text={instance.batch} />
)}
{statusKey != null && (
<StatusRenderer
status={statusKey}
fallbackStatus={instance.status}
type={ModelType.stockitem}
/>
)}
</Group>
);