From 7a43c3a83ec145cc81fb463024dc111488c065a1 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 13 Mar 2025 01:35:29 +1100 Subject: [PATCH] Auto-fill currency for new supplier part (#9286) - Closes https://github.com/inventree/InvenTree/issues/9284 --- src/frontend/src/pages/company/SupplierPartDetail.tsx | 2 +- .../src/tables/purchasing/SupplierPriceBreakTable.tsx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/frontend/src/pages/company/SupplierPartDetail.tsx b/src/frontend/src/pages/company/SupplierPartDetail.tsx index 307f59d5cf..50c1d61ac4 100644 --- a/src/frontend/src/pages/company/SupplierPartDetail.tsx +++ b/src/frontend/src/pages/company/SupplierPartDetail.tsx @@ -276,7 +276,7 @@ export default function SupplierPartDetail() { label: t`Supplier Pricing`, icon: , content: supplierPart?.pk ? ( - + ) : ( ) diff --git a/src/frontend/src/tables/purchasing/SupplierPriceBreakTable.tsx b/src/frontend/src/tables/purchasing/SupplierPriceBreakTable.tsx index e3f195bb0f..e56207b450 100644 --- a/src/frontend/src/tables/purchasing/SupplierPriceBreakTable.tsx +++ b/src/frontend/src/tables/purchasing/SupplierPriceBreakTable.tsx @@ -111,9 +111,9 @@ export function SupplierPriceBreakColumns(): TableColumn[] { } export default function SupplierPriceBreakTable({ - supplierPartId + supplierPart }: Readonly<{ - supplierPartId: number; + supplierPart: any; }>) { const table = useTable('supplierpricebreaks'); @@ -142,7 +142,8 @@ export default function SupplierPriceBreakTable({ title: t`Add Price Break`, fields: supplierPriceBreakFields, initialData: { - part: supplierPartId + part: supplierPart.pk, + price_currency: supplierPart.supplier_detail.currency }, table: table }); @@ -208,7 +209,7 @@ export default function SupplierPriceBreakTable({ tableState={table} props={{ params: { - part: supplierPartId, + part: supplierPart.pk, part_detail: true, supplier_detail: true },