mirror of
https://github.com/inventree/InvenTree.git
synced 2026-02-19 13:18:03 +00:00
[UI] Hide "accept_incomplete_allocation" field (#11362)
- Hide this field if the build does not have any tracked items - Ref: https://github.com/inventree/InvenTree/discussions/11324
This commit is contained in:
@@ -299,10 +299,12 @@ function BuildOutputFormRow({
|
||||
export function useCompleteBuildOutputsForm({
|
||||
build,
|
||||
outputs,
|
||||
hasTrackedItems,
|
||||
onFormSuccess
|
||||
}: {
|
||||
build: any;
|
||||
outputs: any[];
|
||||
hasTrackedItems: boolean;
|
||||
onFormSuccess: (response: any) => void;
|
||||
}) {
|
||||
const [location, setLocation] = useState<number | null>(null);
|
||||
@@ -353,9 +355,11 @@ export function useCompleteBuildOutputsForm({
|
||||
}
|
||||
},
|
||||
notes: {},
|
||||
accept_incomplete_allocation: {}
|
||||
accept_incomplete_allocation: {
|
||||
hidden: !hasTrackedItems
|
||||
}
|
||||
};
|
||||
}, [location, outputs]);
|
||||
}, [location, outputs, hasTrackedItems]);
|
||||
|
||||
return useCreateApiFormModal({
|
||||
url: apiUrl(ApiEndpoints.build_output_complete, build.pk),
|
||||
|
||||
@@ -309,6 +309,7 @@ export default function BuildOutputTable({
|
||||
const completeBuildOutputsForm = useCompleteBuildOutputsForm({
|
||||
build: build,
|
||||
outputs: selectedOutputs,
|
||||
hasTrackedItems: hasTrackedItems,
|
||||
onFormSuccess: () => {
|
||||
table.refreshTable(true);
|
||||
refreshBuild();
|
||||
|
||||
Reference in New Issue
Block a user