diff --git a/src/frontend/src/components/forms/fields/RelatedModelField.tsx b/src/frontend/src/components/forms/fields/RelatedModelField.tsx index 0775f9ab8c..3c1744faba 100644 --- a/src/frontend/src/components/forms/fields/RelatedModelField.tsx +++ b/src/frontend/src/components/forms/fields/RelatedModelField.tsx @@ -99,9 +99,9 @@ export function RelatedModelField({ ); } + onChange(value); setInitialData(value); dataRef.current = [value]; - setPk(data.results[0][pk_field]); } } }); @@ -364,6 +364,7 @@ export function RelatedModelField({ options={data} filterOption={null} onInputChange={(value: any) => { + console.log('onInputChange', value); setValue(value); }} onChange={onChange} diff --git a/src/frontend/tests/pui_printing.spec.ts b/src/frontend/tests/pui_printing.spec.ts index 82ca8d187b..7bcef70df4 100644 --- a/src/frontend/tests/pui_printing.spec.ts +++ b/src/frontend/tests/pui_printing.spec.ts @@ -8,7 +8,7 @@ import { setPluginState } from './settings.js'; * Select a number of stock items from the table, * and print labels against them */ -test('Label Printing', async ({ browser }) => { +test('Printing - Label Printing', async ({ browser }) => { const page = await doCachedLogin(browser, { url: 'stock/location/index/' }); await page.waitForURL('**/web/stock/location/**'); @@ -52,7 +52,7 @@ test('Label Printing', async ({ browser }) => { * Navigate to a PurchaseOrder detail page, * and print a report against it. */ -test('Report Printing', async ({ browser }) => { +test('Printing - Report Printing', async ({ browser }) => { const page = await doCachedLogin(browser, { url: 'stock/location/index/' }); await page.waitForURL('**/web/stock/location/**'); @@ -68,19 +68,16 @@ test('Report Printing', async ({ browser }) => { await page.getByLabel('action-menu-printing-actions').click(); await page.getByLabel('action-menu-printing-actions-print-reports').click(); - // Select template - await page.getByLabel('related-field-template').click(); - await page.getByRole('option', { name: 'InvenTree Purchase Order' }).click(); - - // Submit the print form (should result in success) + // Template should auto-fill (there is only one template available) + await page.getByText('Sample purchase order report').waitFor(); await page.getByRole('button', { name: 'Print', exact: true }).isEnabled(); await page.getByRole('button', { name: 'Print', exact: true }).click(); - await page.getByText('Process completed successfully').first().waitFor(); + await page.context().close(); }); -test('Report Editing', async ({ browser, request }) => { +test('Printing - Report Editing', async ({ browser, request }) => { const page = await doCachedLogin(browser, { username: 'admin', password: 'inventree'