2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-02 05:26:45 +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({
create: false,
stockItem: stockitem,
partId: stockitem.part
});

View File

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