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) (#9287)

- Closes https://github.com/inventree/InvenTree/issues/9284

(cherry picked from commit 7a43c3a83ec145cc81fb463024dc111488c065a1)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
github-actions[bot] 2025-03-13 02:02:49 +11:00 committed by GitHub
parent 1ae27a6b77
commit 21d266ab95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 5 deletions

View File

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