Updated badge logic to only display on build order and sales order
This commit is contained in:
parent
a4d067fbe2
commit
4960918846
|
|
@ -108,11 +108,11 @@ 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 =
|
||||
props.extra?.show_status === true &&
|
||||
!!statusCodes &&
|
||||
Object.values(statusCodes.values).some(
|
||||
(entry) =>
|
||||
|
|
|
|||
|
|
@ -570,6 +570,9 @@ function BuildAllocateLineRow({
|
|||
field_type: 'related field',
|
||||
api_url: apiUrl(ApiEndpoints.stock_item_list),
|
||||
model: ModelType.stockitem,
|
||||
modelRenderer: ({ instance }: { instance: any }) => (
|
||||
<RenderStockItem instance={instance} extra={{ show_status: true }} />
|
||||
),
|
||||
autoFill: !output || !!output?.serial,
|
||||
autoFillFilters: {
|
||||
serial: output?.serial
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import { ApiEndpoints } from '@lib/enums/ApiEndpoints';
|
|||
import { ModelType } from '@lib/enums/ModelType';
|
||||
import RemoveRowButton from '../components/buttons/RemoveRowButton';
|
||||
import { StandaloneField } from '../components/forms/StandaloneField';
|
||||
import { RenderStockItem } from '../components/render/Stock';
|
||||
|
||||
import { ProgressBar } from '@lib/components/ProgressBar';
|
||||
import { apiUrl } from '@lib/functions/Api';
|
||||
|
|
@ -318,6 +319,9 @@ function SalesOrderAllocateLineRow({
|
|||
field_type: 'related field',
|
||||
api_url: apiUrl(ApiEndpoints.stock_item_list),
|
||||
model: ModelType.stockitem,
|
||||
modelRenderer: ({ instance }: { instance: any }) => (
|
||||
<RenderStockItem instance={instance} extra={{ show_status: true }} />
|
||||
),
|
||||
autoFill: true,
|
||||
filters: {
|
||||
available: true,
|
||||
|
|
|
|||
Loading…
Reference in New Issue