mirror of
https://github.com/inventree/InvenTree.git
synced 2026-08-19 19:49:48 +00:00
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:
@@ -13,6 +13,7 @@ import {
|
|||||||
type InstanceRenderInterface,
|
type InstanceRenderInterface,
|
||||||
RenderInlineModel
|
RenderInlineModel
|
||||||
} from './Instance';
|
} from './Instance';
|
||||||
|
import { StatusRenderer } from './StatusRenderer';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inline rendering of a single StockLocation instance
|
* Inline rendering of a single StockLocation instance
|
||||||
@@ -102,6 +103,8 @@ export function RenderStockItem(
|
|||||||
const showLocation: boolean = props.extra?.show_location !== false;
|
const showLocation: boolean = props.extra?.show_location !== false;
|
||||||
const location: any = props.instance?.location_detail;
|
const location: any = props.instance?.location_detail;
|
||||||
|
|
||||||
|
const statusKey = instance?.status_custom_key ?? instance?.status;
|
||||||
|
|
||||||
// Form the "secondary" text to display
|
// Form the "secondary" text to display
|
||||||
const secondary: ReactNode = (
|
const secondary: ReactNode = (
|
||||||
<Group gap='xs' style={{ paddingLeft: '5px' }}>
|
<Group gap='xs' style={{ paddingLeft: '5px' }}>
|
||||||
@@ -111,6 +114,13 @@ export function RenderStockItem(
|
|||||||
{instance.batch && (
|
{instance.batch && (
|
||||||
<InlineSecondaryBadge title={t`Batch`} text={instance.batch} />
|
<InlineSecondaryBadge title={t`Batch`} text={instance.batch} />
|
||||||
)}
|
)}
|
||||||
|
{statusKey != null && (
|
||||||
|
<StatusRenderer
|
||||||
|
status={statusKey}
|
||||||
|
fallbackStatus={instance.status}
|
||||||
|
type={ModelType.stockitem}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user