2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-17 23:08:28 +00:00

Stock convert (#11818)

* [UI] Reimplement "convert stock" action

* Add playwright tests
This commit is contained in:
Oliver
2026-04-27 19:59:30 +10:00
committed by GitHub
parent 9958f4a247
commit 65b2283c7f
4 changed files with 71 additions and 16 deletions
@@ -393,6 +393,39 @@ test('Stock - Stock Actions', async ({ browser }) => {
await page.getByLabel('action-menu-stock-operations-return').click();
});
// Test conversion between part variants
test('Stock - Convert', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'stock/item/242/details' });
await page.getByText('widget.red.00 | Red Widget |').waitFor();
// Convert to widget.red.02
await page
.getByRole('button', { name: 'action-menu-stock-item-actions' })
.click();
await page
.getByRole('menuitem', { name: 'action-menu-stock-item-actions-convert' })
.click();
await page.getByRole('combobox', { name: 'related-field-part' }).fill('red');
await page.getByText('widget.red.02 | Red Widget |').click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('widget.red.02 | Red Widget |').waitFor();
// Convert to widget.red.00
await page
.getByRole('button', { name: 'action-menu-stock-item-actions' })
.click();
await page
.getByRole('menuitem', { name: 'action-menu-stock-item-actions-convert' })
.click();
await page.getByRole('combobox', { name: 'related-field-part' }).fill('red');
await page.getByText('widget.red.00 | Red Widget |').click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('widget.red.00 | Red Widget |').waitFor();
});
test('Stock - Return Items', async ({ browser }) => {
const page = await doCachedLogin(browser, {
url: 'sales/customer/32/assigned-stock'