diff --git a/src/frontend/src/pages/stock/StockDetail.tsx b/src/frontend/src/pages/stock/StockDetail.tsx index f3b2c568e2..a4bebea28d 100644 --- a/src/frontend/src/pages/stock/StockDetail.tsx +++ b/src/frontend/src/pages/stock/StockDetail.tsx @@ -752,10 +752,9 @@ export default function StockDetail() { name: t`Serialize`, tooltip: t`Serialize stock`, hidden: - !canTransfer || isBuilding || serialized || - stockitem?.quantity != 1 || + stockitem?.quantity < 1 || stockitem?.part_detail?.trackable != true, icon: , onClick: () => { diff --git a/src/frontend/tests/pages/pui_stock.spec.ts b/src/frontend/tests/pages/pui_stock.spec.ts index 7cc4dfaa79..2fce81e152 100644 --- a/src/frontend/tests/pages/pui_stock.spec.ts +++ b/src/frontend/tests/pages/pui_stock.spec.ts @@ -165,6 +165,22 @@ test('Stock - Serial Numbers', async ({ browser }) => { await page.getByRole('button', { name: 'Cancel' }).click(); }); +test('Stock - Serialize', async ({ browser }) => { + const page = await doCachedLogin(browser, { url: 'stock/item/232/details' }); + + // Fill out with faulty serial numbers to check buttons and forms + await page.getByLabel('action-menu-stock-operations').click(); + await page.getByLabel('action-menu-stock-operations-serialize').click(); + + await page.getByLabel('text-field-serial_numbers').fill('200-250'); + + await page.getByRole('button', { name: 'Submit' }).click(); + await page + .getByText('Group range 200-250 exceeds allowed quantity') + .waitFor(); + await page.getByRole('button', { name: 'Cancel' }).click(); +}); + /** * Test various 'actions' on the stock detail page */