2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-25 04:23:33 +00:00

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
This commit is contained in:
Matthias Mair
2026-04-23 01:27:50 +02:00
committed by GitHub
parent 8830d506b9
commit 91977bd070
+7 -1
View File
@@ -12,6 +12,7 @@ import { RenderPart } from '../components/render/Part';
import { showApiErrorMessage } from '../functions/notifications'; import { showApiErrorMessage } from '../functions/notifications';
import { useCreateApiFormModal } from '../hooks/UseForm'; import { useCreateApiFormModal } from '../hooks/UseForm';
import { useUserState } from '../states/UserState'; import { useUserState } from '../states/UserState';
import { usePartFields } from './PartForms';
/** /**
* Field set for BomItem form * Field set for BomItem form
@@ -21,6 +22,10 @@ export function bomItemFields({
}: { }: {
showAssembly?: boolean; showAssembly?: boolean;
}): ApiFormFieldSet { }): ApiFormFieldSet {
const newPartFields = usePartFields({
create: true
});
return { return {
part: { part: {
disabled: true, disabled: true,
@@ -30,7 +35,8 @@ export function bomItemFields({
filters: { filters: {
active: true, // Only show active parts when creating a new BOM item active: true, // Only show active parts when creating a new BOM item
component: true component: true
} },
addCreateFields: newPartFields
}, },
quantity: {}, quantity: {},
reference: {}, reference: {},