2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-04-07 12:00:58 +00:00

Build consume fix (#11529)

* Add new build task

* Refactor background task for consuming build stock

- Run as a single task
- Improve query efficiency

* Refactor consuming stock against build via API

- Return task_id for monitoring
- Keep frontend updated

* Task tracking for auto-allocation

* Add e2e integration tests:

- Auto-allocate stock
- Consume stock

* Bump API version

* Playwright test fixes

* Adjust unit tests

* Robustify unit test

* Widen test scope

* Adjust playwright test

* Loosen test requirements again

* idk, another change :|

* Robustify test
This commit is contained in:
Oliver
2026-03-17 20:51:12 +11:00
committed by GitHub
parent 97aec82d33
commit 84cd81d9a8
13 changed files with 283 additions and 185 deletions

View File

@@ -442,6 +442,22 @@ test('Purchase Orders - Receive Items', async ({ browser }) => {
await navigate(page, 'purchasing/purchase-order/2/line-items');
const cell = await page.getByText('Red Paint', { exact: true });
// First, ensure that the row has sufficient quantity to receive
// This is required to ensure the robustness of this test,
// as the test data may be modified by other tests
await clickOnRowMenu(cell);
await page.getByRole('menuitem', { name: 'Edit' }).click();
const quantityInput = await page.getByRole('textbox', {
name: 'number-field-quantity'
});
const quantity = Number.parseInt(await quantityInput.inputValue());
await quantityInput.fill((quantity + 100).toString());
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Item Updated').waitFor();
// Now, receive the items
await clickOnRowMenu(cell);
await page.getByRole('menuitem', { name: 'Receive line item' }).click();
@@ -451,6 +467,7 @@ test('Purchase Orders - Receive Items', async ({ browser }) => {
// Receive only a *single* item
await page.getByLabel('number-field-quantity').fill('1');
await page.waitForTimeout(500);
// Assign custom information
await page.getByLabel('action-button-assign-batch-').click();
@@ -477,6 +494,9 @@ test('Purchase Orders - Receive Items', async ({ browser }) => {
await loadTab(page, 'Received Stock');
await clearTableFilters(page);
await page
.getByRole('textbox', { name: 'table-search-input' })
.fill('my-batch-code');
await page.getByRole('cell', { name: 'my-batch-code' }).first().waitFor();
});