mirror of
https://github.com/inventree/InvenTree.git
synced 2026-08-19 11:39:50 +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,
|
||||
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>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user