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

Receive virtual parts (#11627)

* Handle receive of virtual parts

- Update line item quantity
- Do not add any stock

* Add unit test

* Additional unit test

* UI form improvements

* Add playwright test

* Updated playwright tests
This commit is contained in:
Oliver
2026-03-30 19:10:56 +11:00
committed by GitHub
parent b4f230753f
commit dab4319033
7 changed files with 145 additions and 30 deletions

View File

@@ -82,13 +82,13 @@ test('Company - Supplier Parts', async ({ browser }) => {
await loadTab(page, 'Supplier Parts');
await clearTableFilters(page);
await page.getByText('- 25 / 777').waitFor();
await page.getByText(/1 \- 25 \/ 77\d/).waitFor();
await setTableChoiceFilter(page, 'Primary', 'Yes');
await page.getByText('- 25 / 318').waitFor();
await page.getByText(/1 \- 25 \/ 31\d/).waitFor();
await clearTableFilters(page);
await setTableChoiceFilter(page, 'Primary', 'No');
await page.getByText('- 25 / 459').waitFor();
await page.getByText(/1 \- 25 \/ 45\d/).waitFor();
});

View File

@@ -500,6 +500,39 @@ test('Purchase Orders - Receive Items', async ({ browser }) => {
await page.getByRole('cell', { name: 'my-batch-code' }).first().waitFor();
});
test('Purchase Orders - Receive Virtual Items', async ({ browser }) => {
const page = await doCachedLogin(browser, {
url: 'purchasing/purchase-order/19'
});
// Duplicate this order
await page.getByRole('button', { name: 'action-menu-order-actions' }).click();
await page.getByRole('menuitem', { name: 'Duplicate' }).click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByRole('tab', { name: 'Order Details' }).waitFor();
// Issue the new order
await page.getByRole('button', { name: 'Issue Order' }).click();
await page.getByRole('button', { name: 'Submit' }).click();
// Receive the line item
await loadTab(page, 'Line Items');
await page.getByRole('checkbox', { name: 'Select all records' }).click();
await page
.getByRole('button', { name: 'action-button-receive-items' })
.click();
await page
.getByRole('combobox', { name: 'related-field-location' })
.fill('factory');
await page.getByText('Factory/Storage Room A').click();
await page.getByRole('button', { name: 'Submit' }).click();
// 1/1 items received
await page.getByText('1 / 1', { exact: true }).waitFor();
});
test('Purchase Orders - Duplicate', async ({ browser }) => {
const page = await doCachedLogin(browser, {
url: 'purchasing/purchase-order/13/detail'