From 3dbe168939d2479ba95279a8dea1975324da8c97 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 19 Feb 2026 17:18:53 +1100 Subject: [PATCH] [UI] Bug fix for stock column ordering (#11376) - Cannot have a blank accessor --- src/frontend/src/tables/ColumnRenderers.tsx | 3 ++- src/frontend/src/tables/InvenTreeTable.tsx | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/tables/ColumnRenderers.tsx b/src/frontend/src/tables/ColumnRenderers.tsx index 966cf004a2..d025e423a8 100644 --- a/src/frontend/src/tables/ColumnRenderers.tsx +++ b/src/frontend/src/tables/ColumnRenderers.tsx @@ -114,9 +114,10 @@ export type StockColumnProps = TableColumnProps & { // Render a StockItem instance within a table export function StockColumn(props: StockColumnProps): TableColumn { return { - accessor: props.accessor ?? 'stock_item', title: t`Stock Item`, ...props, + ordering: props.ordering || 'stock', + accessor: props.accessor || 'stock', render: (record: any) => { const stock_item = resolveItem(record, props.accessor ?? 'stock_item_detail') ?? {}; diff --git a/src/frontend/src/tables/InvenTreeTable.tsx b/src/frontend/src/tables/InvenTreeTable.tsx index 64d6c93876..a8b0e68135 100644 --- a/src/frontend/src/tables/InvenTreeTable.tsx +++ b/src/frontend/src/tables/InvenTreeTable.tsx @@ -486,6 +486,10 @@ export function InvenTreeTable>({ tableState.setPage(1); setSortStatus(status); + if (!status.columnAccessor) { + console.error('Invalid column accessor provided for table sorting'); + } + setTableSorting(cacheKey)(status); }, [cacheKey]