2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-05-06 17:53:44 +00:00

[UI] BOM pricing fix (#11860)

* Ensure BOM pricing is fetched

* Enable IPN sorting for "used-in" table

* Update playwright tests
This commit is contained in:
Oliver
2026-05-04 21:15:32 +10:00
committed by GitHub
parent cc60692388
commit 2a5925f4f7
4 changed files with 19 additions and 4 deletions
@@ -186,6 +186,7 @@ export default function BomPricingPanel({
params: { params: {
part: part?.pk, part: part?.pk,
sub_part_detail: true, sub_part_detail: true,
pricing: true,
has_pricing: true has_pricing: true
}, },
enableSelection: false, enableSelection: false,
+1
View File
@@ -718,6 +718,7 @@ export function BomTable({
params: { params: {
...params, ...params,
part: partId, part: partId,
pricing: true,
substitutes: true, substitutes: true,
part_detail: true, part_detail: true,
sub_part_detail: true, sub_part_detail: true,
+1 -1
View File
@@ -42,7 +42,7 @@ export function UsedInTable({
part: 'part_detail' part: 'part_detail'
}), }),
IPNColumn({ IPNColumn({
sortable: false sortable: true
}), }),
{ {
accessor: 'part_detail.revision', accessor: 'part_detail.revision',
+16 -3
View File
@@ -168,6 +168,12 @@ test('Parts - BOM', async ({ browser }) => {
await navigate(page, 'part/87/bom'); await navigate(page, 'part/87/bom');
await loadTab(page, 'Bill of Materials'); await loadTab(page, 'Bill of Materials');
// Check for pricing data to be displayed in the table
await page
.getByRole('cell', { name: /\$\d+\.\d+ - \$\d+\.\d+/ })
.first()
.waitFor();
// Mouse-hover to display BOM validation info for this assembly // Mouse-hover to display BOM validation info for this assembly
await page.getByRole('button', { name: 'bom-validation-info' }).hover(); await page.getByRole('button', { name: 'bom-validation-info' }).hover();
await page await page
@@ -552,7 +558,14 @@ test('Parts - Pricing (Nothing, BOM)', async ({ browser }) => {
await page.getByRole('button', { name: 'Quantity Not sorted' }).waitFor(); await page.getByRole('button', { name: 'Quantity Not sorted' }).waitFor();
await page.getByRole('button', { name: 'Unit Price Not sorted' }).waitFor(); await page.getByRole('button', { name: 'Unit Price Not sorted' }).waitFor();
// BOM Pricing - linkjumping // We expect some pricing data to be displayed
await page
.getByLabel('BOM Pricing')
.getByRole('cell', { name: /\$0\.\d+ - \$0\.\d+/ })
.first()
.waitFor();
// BOM Pricing - link-jumping
await page await page
.getByLabel('BOM Pricing') .getByLabel('BOM Pricing')
.getByRole('table') .getByRole('table')
@@ -577,7 +590,7 @@ test('Parts - Pricing (Supplier)', async ({ browser }) => {
await page.getByRole('button', { name: 'Supplier Pricing' }).click(); await page.getByRole('button', { name: 'Supplier Pricing' }).click();
await page.getByRole('button', { name: 'SKU Not sorted' }).waitFor(); await page.getByRole('button', { name: 'SKU Not sorted' }).waitFor();
// Supplier Pricing - linkjumping // Supplier Pricing - link-jumping
const target = page.getByText('ARR-26041-LPC').first(); const target = page.getByText('ARR-26041-LPC').first();
await target.waitFor(); await target.waitFor();
await target.click(); await target.click();
@@ -599,7 +612,7 @@ test('Parts - Pricing (Variant)', async ({ browser }) => {
// Variant Pricing // Variant Pricing
await page.getByRole('button', { name: 'Variant Pricing' }).click(); await page.getByRole('button', { name: 'Variant Pricing' }).click();
// Variant Pricing - linkjumping // Variant Pricing - link-jumping
const target = page.getByText('Green Chair').first(); const target = page.getByText('Green Chair').first();
await target.waitFor(); await target.waitFor();
await target.click(); await target.click();