2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-02 21:38:48 +00:00

Fix for stock item edit (#8451)

- Pass stockItem instance through to form
This commit is contained in:
Oliver 2024-11-08 13:22:46 +11:00 committed by GitHub
parent 011108cb50
commit 8f24119f29
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View File

@ -536,6 +536,7 @@ export default function StockDetail() {
const editStockItemFields = useStockFields({ const editStockItemFields = useStockFields({
create: false, create: false,
stockItem: stockitem,
partId: stockitem.part partId: stockitem.part
}); });

View File

@ -414,12 +414,15 @@ export function StockItemTable({
}; };
}, [table]); }, [table]);
const stockItemFields = useStockFields({ create: true, partId: params.part }); const newStockItemFields = useStockFields({
create: true,
partId: params.part
});
const newStockItem = useCreateApiFormModal({ const newStockItem = useCreateApiFormModal({
url: ApiEndpoints.stock_item_list, url: ApiEndpoints.stock_item_list,
title: t`Add Stock Item`, title: t`Add Stock Item`,
fields: stockItemFields, fields: newStockItemFields,
initialData: { initialData: {
part: params.part, part: params.part,
location: params.location location: params.location