2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-13 22:21:37 +00:00

[refactor] Stock return API endpoints (#10132)

* Add "StockReturn" API endpoint

- Provide multiple items
- Provide quantity for each item

* Add frontend form

* update frontend forms

* Refactor frontend

* Allow splitting quantity

* Refactoring backend endpoints

* cleanup

* Update unit test

* unit tests

* Bump API version

* Fix unit test

* Add tests for returning build items to stock

* Playwright tests

* Enhanced unit tests

* Add docs
This commit is contained in:
Oliver
2025-08-07 10:47:26 +10:00
committed by GitHub
parent c4011d0be3
commit f1b5f2c379
23 changed files with 427 additions and 143 deletions

View File

@@ -299,6 +299,39 @@ test('Stock - Stock Actions', async ({ browser }) => {
await page.getByLabel('action-menu-stock-operations-return').click();
});
test('Stock - Return Items', async ({ browser }) => {
const page = await doCachedLogin(browser, {
url: 'sales/customer/32/assigned-stock'
});
// Return stock items assigned to customer
await page.getByRole('cell', { name: 'Select all records' }).click();
await page.getByRole('button', { name: 'action-menu-stock-actions' }).click();
await page
.getByRole('menuitem', { name: 'action-menu-stock-actions-return-stock' })
.click();
await page.getByText('Return selected items into stock').first().waitFor();
await page.getByRole('button', { name: 'Cancel' }).click();
// Location detail
await navigate(page, 'stock/item/1253');
await page
.getByRole('button', { name: 'action-menu-stock-operations' })
.click();
await page
.getByRole('menuitem', {
name: 'action-menu-stock-operations-return-stock'
})
.click();
await page.getByText('#128').waitFor();
await page.getByText('Merge into existing stock').waitFor();
await page.getByRole('textbox', { name: 'number-field-quantity' }).fill('0');
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByText('Quantity must be greater than zero').waitFor();
await page.getByText('This field is required.').waitFor();
});
test('Stock - Tracking', async ({ browser }) => {
const page = await doCachedLogin(browser, { url: 'stock/item/176/details' });