From 91977bd070d442d4c6489de8d0172c3ca801e2e1 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Thu, 23 Apr 2026 01:27:50 +0200 Subject: [PATCH] feat(frontend): add inline component addition to bom dialog (#11781) * feat(frontend): add inline component addition to BOM dialog closes https://github.com/invenhost/InvenTree/issues/311 * adapt to new var name --- src/frontend/src/forms/BomForms.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/forms/BomForms.tsx b/src/frontend/src/forms/BomForms.tsx index d512c66428..f701c9e517 100644 --- a/src/frontend/src/forms/BomForms.tsx +++ b/src/frontend/src/forms/BomForms.tsx @@ -12,6 +12,7 @@ import { RenderPart } from '../components/render/Part'; import { showApiErrorMessage } from '../functions/notifications'; import { useCreateApiFormModal } from '../hooks/UseForm'; import { useUserState } from '../states/UserState'; +import { usePartFields } from './PartForms'; /** * Field set for BomItem form @@ -21,6 +22,10 @@ export function bomItemFields({ }: { showAssembly?: boolean; }): ApiFormFieldSet { + const newPartFields = usePartFields({ + create: true + }); + return { part: { disabled: true, @@ -30,7 +35,8 @@ export function bomItemFields({ filters: { active: true, // Only show active parts when creating a new BOM item component: true - } + }, + addCreateFields: newPartFields }, quantity: {}, reference: {},