mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-02 10:18:42 +00:00
Merge commit '12825aa1f4f6b47fabc47dda980d74df50d7dad4' into block-notes
This commit is contained in:
@@ -143,7 +143,7 @@
|
||||
"rollup": "^4.61.1",
|
||||
"rollup-plugin-license": "^3.7.1",
|
||||
"typescript": "^5.9.3",
|
||||
"vite": "^6.4.2",
|
||||
"vite": "^7.0.0",
|
||||
"vite-plugin-babel-macros": "^1.0.6",
|
||||
"vite-plugin-dts": "^5.0.2",
|
||||
"vite-plugin-externals": "^0.6.2",
|
||||
@@ -154,6 +154,8 @@
|
||||
"resolutions": {
|
||||
"glob": "^13.0.0",
|
||||
"undici": "^6.24.0",
|
||||
"vite": "^6.4.2"
|
||||
"vite": "^7",
|
||||
"js-yaml": "^4",
|
||||
"esbuild": "^0.28"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,10 @@ export default function PartDetail() {
|
||||
// Fetch information on parts which are revisions of *this* part
|
||||
const partRevisionQuery = useQuery({
|
||||
refetchOnMount: true,
|
||||
enabled: revisionsEnabled && !!part && !!part.revision_count,
|
||||
enabled:
|
||||
revisionsEnabled &&
|
||||
!!part &&
|
||||
(!!part.revision_count || !!part.revision_of),
|
||||
queryKey: ['part_revisions', part.pk, part.revision_count],
|
||||
queryFn: async () =>
|
||||
api
|
||||
@@ -227,7 +230,23 @@ export default function PartDetail() {
|
||||
revision_of: part.pk
|
||||
}
|
||||
})
|
||||
.then((response) => response.data)
|
||||
.then(async (response) => {
|
||||
let data = response.data;
|
||||
|
||||
// If the part is also a revision, fetch upstream revision information too
|
||||
if (!!part.revision_of) {
|
||||
await api
|
||||
.get(apiUrl(ApiEndpoints.part_list), {
|
||||
params: {
|
||||
revision_of: part.revision_of
|
||||
}
|
||||
})
|
||||
.then((response) => {
|
||||
data = [...data, ...response.data];
|
||||
});
|
||||
}
|
||||
return data;
|
||||
})
|
||||
});
|
||||
|
||||
const partRevisionOptions: any[] = useMemo(() => {
|
||||
|
||||
@@ -431,17 +431,24 @@ export default function StockDetail() {
|
||||
hidden: !stockitem.packaging
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
type: 'date',
|
||||
name: 'creation_date',
|
||||
icon: 'calendar',
|
||||
label: t`Created`,
|
||||
hidden: !stockitem.creation_date
|
||||
},
|
||||
{
|
||||
type: 'date',
|
||||
name: 'updated',
|
||||
icon: 'calendar',
|
||||
label: t`Last Updated`
|
||||
},
|
||||
{
|
||||
type: 'text',
|
||||
name: 'stocktake',
|
||||
type: 'date',
|
||||
name: 'stocktake_date',
|
||||
icon: 'calendar',
|
||||
label: t`Last Stocktake`,
|
||||
hidden: !stockitem.stocktake
|
||||
hidden: !stockitem.stocktake_date
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -94,6 +94,13 @@ export function PartColumn(props: PartColumnProps): TableColumn {
|
||||
sortable: true,
|
||||
switchable: false,
|
||||
minWidth: '175px',
|
||||
copyable: (record: any) => {
|
||||
const part = resolveItem(
|
||||
record,
|
||||
props.part ?? props.accessor ?? 'part_detail'
|
||||
);
|
||||
return part?.full_name ?? part?.name ?? '';
|
||||
},
|
||||
render: (record: any) => {
|
||||
const part = resolveItem(
|
||||
record,
|
||||
@@ -156,7 +163,7 @@ export function StockColumn(props: StockColumnProps): TableColumn {
|
||||
text = `# ${stock_item.serial}`;
|
||||
}
|
||||
|
||||
if (record.is_building) {
|
||||
if (stock_item.is_building) {
|
||||
color = 'blue';
|
||||
extra.push(
|
||||
<Text
|
||||
@@ -164,35 +171,35 @@ export function StockColumn(props: StockColumnProps): TableColumn {
|
||||
size='sm'
|
||||
>{t`This stock item is in production`}</Text>
|
||||
);
|
||||
} else if (record.sales_order) {
|
||||
} else if (stock_item.sales_order) {
|
||||
extra.push(
|
||||
<Text
|
||||
key='sales-order'
|
||||
size='sm'
|
||||
>{t`This stock item has been assigned to a sales order`}</Text>
|
||||
);
|
||||
} else if (record.customer) {
|
||||
} else if (stock_item.customer) {
|
||||
extra.push(
|
||||
<Text
|
||||
key='customer'
|
||||
size='sm'
|
||||
>{t`This stock item has been assigned to a customer`}</Text>
|
||||
);
|
||||
} else if (record.belongs_to) {
|
||||
} else if (stock_item.belongs_to) {
|
||||
extra.push(
|
||||
<Text
|
||||
key='belongs-to'
|
||||
size='sm'
|
||||
>{t`This stock item is installed in another stock item`}</Text>
|
||||
);
|
||||
} else if (record.consumed_by) {
|
||||
} else if (stock_item.consumed_by) {
|
||||
extra.push(
|
||||
<Text
|
||||
key='consumed-by'
|
||||
size='sm'
|
||||
>{t`This stock item has been consumed by a build order`}</Text>
|
||||
);
|
||||
} else if (!record.in_stock) {
|
||||
} else if (!stock_item.in_stock) {
|
||||
extra.push(
|
||||
<Text
|
||||
key='unavailable'
|
||||
@@ -201,17 +208,17 @@ export function StockColumn(props: StockColumnProps): TableColumn {
|
||||
);
|
||||
}
|
||||
|
||||
if (record.expired) {
|
||||
if (stock_item.expired) {
|
||||
extra.push(
|
||||
<Text key='expired' size='sm'>{t`This stock item has expired`}</Text>
|
||||
);
|
||||
} else if (record.stale) {
|
||||
} else if (stock_item.stale) {
|
||||
extra.push(
|
||||
<Text key='stale' size='sm'>{t`This stock item is stale`}</Text>
|
||||
);
|
||||
}
|
||||
|
||||
if (record.in_stock) {
|
||||
if (stock_item.in_stock) {
|
||||
if (allocated > 0) {
|
||||
if (allocated > quantity) {
|
||||
color = 'red';
|
||||
@@ -267,7 +274,7 @@ export function StockColumn(props: StockColumnProps): TableColumn {
|
||||
}
|
||||
}
|
||||
|
||||
if (!record.in_stock) {
|
||||
if (!stock_item.in_stock) {
|
||||
color = 'red';
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ export function TableHoverCard({
|
||||
zIndex={zIndex}
|
||||
>
|
||||
<HoverCard.Target>
|
||||
<Group gap='xs' justify='space-between'>
|
||||
<Group gap='xs' justify='space-between' wrap='nowrap'>
|
||||
{value}
|
||||
<InvenTreeIcon
|
||||
icon={icon ?? 'info'}
|
||||
|
||||
@@ -304,6 +304,7 @@ export default function BuildLineTable({
|
||||
<Text
|
||||
c='red'
|
||||
style={{ fontStyle: 'italic' }}
|
||||
size='sm'
|
||||
>{t`No stock available`}</Text>
|
||||
)
|
||||
}
|
||||
@@ -447,7 +448,9 @@ export default function BuildLineTable({
|
||||
extra={extra}
|
||||
value={
|
||||
<Group justify='space-between' wrap='nowrap'>
|
||||
<Text>{formatDecimal(record.requiredQuantity)}</Text>
|
||||
<Text size='sm'>
|
||||
{formatDecimal(record.requiredQuantity)}
|
||||
</Text>
|
||||
{record?.part_detail?.units && (
|
||||
<Text size='xs'>[{record.part_detail.units}]</Text>
|
||||
)}
|
||||
|
||||
@@ -181,7 +181,9 @@ function partTableColumns(): TableColumn[] {
|
||||
<TableHoverCard
|
||||
value={
|
||||
<Group gap='xs' justify='left' wrap='nowrap'>
|
||||
<Text c={color}>{text}</Text>
|
||||
<Text c={color} size='sm'>
|
||||
{text}
|
||||
</Text>
|
||||
{record.units && (
|
||||
<Text size='xs' c={color}>
|
||||
[{record.units}]
|
||||
|
||||
@@ -86,6 +86,7 @@ function stockItemTableColumns({
|
||||
'allocated',
|
||||
'consumed',
|
||||
'installed',
|
||||
'in_stock',
|
||||
'sent_to_customer'
|
||||
]
|
||||
}),
|
||||
|
||||
+391
-571
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user