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:
@ -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">
|
||||
|
@ -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={
|
||||
|
@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user