2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-12-17 09:48:30 +00:00

[bug] Stock adjust (#10914)

* Extra checks on backend

* Bug fix for adjustment forms

- Set default quantity of zero

* Additional unit testing (to ensure no regression)
This commit is contained in:
Oliver
2025-11-26 22:32:57 +11:00
committed by GitHub
parent 16b600af88
commit 5713cff1cb
3 changed files with 37 additions and 3 deletions

View File

@@ -332,6 +332,11 @@ test('Stock - Stock Actions', async ({ browser }) => {
await page.getByRole('button', { name: 'Scan', exact: true }).click();
await page.getByText('Scanned stock item into location').waitFor();
// Add "zero" stock - ensure the quantity stays the same
await launchStockAction('add');
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Quantity: 123').first().waitFor();
// Add stock, and change status
await launchStockAction('add');
await page.getByLabel('number-field-quantity').fill('12');
@@ -342,6 +347,11 @@ test('Stock - Stock Actions', async ({ browser }) => {
await page.getByText('Unavailable').first().waitFor();
await page.getByText('135').first().waitFor();
// Remove "zero" stock - ensure the quantity stays the same
await launchStockAction('remove');
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Quantity: 135').first().waitFor();
// Remove stock, and change status
await launchStockAction('remove');
await page.getByLabel('number-field-quantity').fill('99');