2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 03:26:45 +00:00

Serialize stock fix (#9441) (#9443)

* Fix bug which hid the "serialize stock" button

* Add playwright tests

* Adjust check

(cherry picked from commit a18b18a3fd845593ce0a9dcd2a001b8c9c272dc3)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot] 2025-04-03 09:04:15 +11:00 committed by GitHub
parent 3c71d62d27
commit 5e26394500
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 2 deletions

View File

@ -743,10 +743,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: <InvenTreeIcon icon='serial' iconProps={{ color: 'blue' }} />,
onClick: () => {

View File

@ -152,6 +152,22 @@ test('Stock - Serial Numbers', async ({ page }) => {
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
*/