2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-14 21:22:20 +00:00

Fix rendering for custom status values (#10492)

- Improve field lookup priority
This commit is contained in:
Oliver
2025-10-05 22:34:47 +11:00
committed by GitHub
parent 946d4358c3
commit b370d54394
2 changed files with 6 additions and 3 deletions

View File

@@ -194,7 +194,10 @@ export function TableStatusRenderer(
accessor?: string
): ((record: any) => any) | undefined {
return (record: any) => {
const status = resolveItem(record, accessor ?? 'status');
const status =
resolveItem(record, accessor ?? 'status') ??
resolveItem(record, 'status_custom_key') ??
resolveItem(record, 'status');
return (
status && (

View File

@@ -368,14 +368,14 @@ export type StatusColumnProps = TableColumnProps & {
};
export function StatusColumn(props: StatusColumnProps): TableColumn {
const accessor: string = props.accessor ?? 'status';
const accessor: string = props.accessor ?? 'status_custom_key';
return {
accessor: 'status',
sortable: true,
switchable: true,
minWidth: '50px',
render: TableStatusRenderer(props.model, accessor ?? 'status_custom_key'),
render: TableStatusRenderer(props.model, accessor),
...props
};
}