2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-16 20:15:44 +00:00

BOM / Build Updates (#6604)

* Fix for build line table

- Prefill source location correctly

* Refactor API filtering for BomList

- Make use of RestFilter class

* Add "external stock" field to BomItem serializer

* Simplify custom filtering

* Add "structural" column to part table

* Update BOM tables:

- Display indication of "external stock"

* Annotate "external_stock" to part serializer

- Update PartTable [PUI]

* Annotate BuildLine serializer too

* BuildLine endpoint - filter available stock based on source build order

- If build order is specified, and has a source location, use that to filter available stock!

* Add message above build line table

* Update BuildLineTable

* Bump API version
This commit is contained in:
Oliver
2024-02-29 16:16:28 +11:00
committed by GitHub
parent 05e67d310a
commit 37c1fe1ccb
13 changed files with 183 additions and 79 deletions

View File

@ -142,7 +142,7 @@ export function BomTable({
},
{
accessor: 'available_stock',
sortable: true,
render: (record) => {
let extra: ReactNode[] = [];
@ -157,6 +157,14 @@ export function BomTable({
available_stock
);
if (record.external_stock > 0) {
extra.push(
<Text key="external">
{t`External stock`}: {record.external_stock}
</Text>
);
}
if (record.available_substitute_stock > 0) {
extra.push(
<Text key="substitute">

View File

@ -94,6 +94,15 @@ export default function BuildLineTable({ params = {} }: { params?: any }) {
);
}
// Account for "external" stock
if (record.external_stock > 0) {
extra.push(
<Text key="external" size="sm">
{t`External stock`}: {record.external_stock}
</Text>
);
}
return (
<TableHoverCard
value={

View File

@ -113,7 +113,17 @@ function partTableColumns(): TableColumn[] {
if (available != stock) {
extra.push(
<Text key="available">{t`Available` + `: ${available}`}</Text>
<Text key="available">
{t`Available`}: {available}
</Text>
);
}
if (record.external_stock > 0) {
extra.push(
<Text key="external">
{t`External stock`}: {record.external_stock}
</Text>
);
}