2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

Auto-fill currency for new supplier part (#9286)

- Closes https://github.com/inventree/InvenTree/issues/9284
This commit is contained in:
Oliver 2025-03-13 01:35:29 +11:00 committed by GitHub
parent 0049544305
commit 7a43c3a83e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

@ -276,7 +276,7 @@ export default function SupplierPartDetail() {
label: t`Supplier Pricing`, label: t`Supplier Pricing`,
icon: <IconCurrencyDollar />, icon: <IconCurrencyDollar />,
content: supplierPart?.pk ? ( content: supplierPart?.pk ? (
<SupplierPriceBreakTable supplierPartId={supplierPart.pk} /> <SupplierPriceBreakTable supplierPart={supplierPart} />
) : ( ) : (
<Skeleton /> <Skeleton />
) )

View File

@ -111,9 +111,9 @@ export function SupplierPriceBreakColumns(): TableColumn[] {
} }
export default function SupplierPriceBreakTable({ export default function SupplierPriceBreakTable({
supplierPartId supplierPart
}: Readonly<{ }: Readonly<{
supplierPartId: number; supplierPart: any;
}>) { }>) {
const table = useTable('supplierpricebreaks'); const table = useTable('supplierpricebreaks');
@ -142,7 +142,8 @@ export default function SupplierPriceBreakTable({
title: t`Add Price Break`, title: t`Add Price Break`,
fields: supplierPriceBreakFields, fields: supplierPriceBreakFields,
initialData: { initialData: {
part: supplierPartId part: supplierPart.pk,
price_currency: supplierPart.supplier_detail.currency
}, },
table: table table: table
}); });
@ -208,7 +209,7 @@ export default function SupplierPriceBreakTable({
tableState={table} tableState={table}
props={{ props={{
params: { params: {
part: supplierPartId, part: supplierPart.pk,
part_detail: true, part_detail: true,
supplier_detail: true supplier_detail: true
}, },