2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-16 09:18:10 +00:00

[UI] BOM part category (#10772)

* Add "Category" column to BOM Table

* Enable sorting by category in BOM table

* Add Category column to Buildline table

* Add Category filter to BuildLineTable

* Adjust queryset prefetch

* Bump API version and update CHANGELOG
This commit is contained in:
Oliver
2025-11-05 10:04:28 +11:00
committed by GitHub
parent fc3d130888
commit dbb799a0e0
8 changed files with 60 additions and 4 deletions

View File

@@ -42,6 +42,7 @@ import { useTable } from '../../hooks/UseTable';
import { useUserState } from '../../states/UserState';
import {
BooleanColumn,
CategoryColumn,
DescriptionColumn,
NoteColumn,
ReferenceColumn
@@ -133,6 +134,13 @@ export function BomTable({
title: t`IPN`,
sortable: true
},
CategoryColumn({
accessor: 'category_detail',
defaultVisible: false,
switchable: true,
sortable: true,
ordering: 'category'
}),
DescriptionColumn({
accessor: 'sub_part_detail.description'
}),
@@ -662,6 +670,7 @@ export function BomTable({
params: {
...params,
part: partId,
category_detail: true,
part_detail: true,
sub_part_detail: true
},

View File

@@ -43,12 +43,14 @@ import { useTable } from '../../hooks/UseTable';
import { useUserState } from '../../states/UserState';
import {
BooleanColumn,
CategoryColumn,
DecimalColumn,
DescriptionColumn,
LocationColumn,
PartColumn,
RenderPartColumn
} from '../ColumnRenderers';
import { PartCategoryFilter } from '../Filter';
import { InvenTreeTable } from '../InvenTreeTable';
import RowExpansionIcon from '../RowExpansionIcon';
import { TableHoverCard } from '../TableHoverCard';
@@ -214,7 +216,8 @@ export default function BuildLineTable({
name: 'tracked',
label: t`Tracked`,
description: t`Show tracked lines`
}
},
PartCategoryFilter()
];
}, []);
@@ -327,6 +330,13 @@ export default function BuildLineTable({
sortable: false,
title: t`IPN`
},
CategoryColumn({
accessor: 'category_detail',
defaultVisible: false,
switchable: true,
sortable: true,
ordering: 'category'
}),
DescriptionColumn({
accessor: 'part_detail.description'
}),
@@ -947,6 +957,7 @@ export default function BuildLineTable({
...params,
build: build.pk,
assembly_detail: false,
category_detail: true,
part_detail: true
},
tableActions: tableActions,