From 21d266ab95fbae6fdae6f181e357850c72833b9e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Mar 2025 02:02:49 +1100 Subject: [PATCH] Auto-fill currency for new supplier part (#9286) (#9287) - Closes https://github.com/inventree/InvenTree/issues/9284 (cherry picked from commit 7a43c3a83ec145cc81fb463024dc111488c065a1) Co-authored-by: Oliver --- 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 2ccc9763dd..bc03ab1a6a 100644 --- a/src/frontend/src/pages/company/SupplierPartDetail.tsx +++ b/src/frontend/src/pages/company/SupplierPartDetail.tsx @@ -277,7 +277,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 },