2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 03:26:45 +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`,
icon: <IconCurrencyDollar />,
content: supplierPart?.pk ? (
<SupplierPriceBreakTable supplierPartId={supplierPart.pk} />
<SupplierPriceBreakTable supplierPart={supplierPart} />
) : (
<Skeleton />
)

View File

@ -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
},