diff --git a/CHANGELOG.md b/CHANGELOG.md index dbc38cfdda..f49f649aca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- [#12341](https://github.com/inventree/InvenTree/pull/12341) adds support for importing internal part prices. - [#12295](https://github.com/inventree/InvenTree/pull/12295) adds "consumable" field to the Part model and API endpoints - [#12250](https://github.com/inventree/InvenTree/pull/12250) adds "active" field to the ProjectCode model and API endpoints diff --git a/src/backend/InvenTree/InvenTree/api_version.py b/src/backend/InvenTree/InvenTree/api_version.py index c64b88a72d..86096d66fa 100644 --- a/src/backend/InvenTree/InvenTree/api_version.py +++ b/src/backend/InvenTree/InvenTree/api_version.py @@ -1,11 +1,14 @@ """InvenTree API version information.""" # InvenTree API version -INVENTREE_API_VERSION = 517 +INVENTREE_API_VERSION = 518 """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" INVENTREE_API_TEXT = """ +v518 -> 2026-07-09 : https://github.com/inventree/InvenTree/pull/12341 + - Enable import of internal part prices via the API + v517 -> 2026-07-08 : https://github.com/inventree/InvenTree/pull/12336 - Fix currency code options for the PartPricing model and API endpoints diff --git a/src/backend/InvenTree/part/migrations/0067_partinternalpricebreak.py b/src/backend/InvenTree/part/migrations/0067_partinternalpricebreak.py index c290bd6ec9..b4e6be8f8c 100644 --- a/src/backend/InvenTree/part/migrations/0067_partinternalpricebreak.py +++ b/src/backend/InvenTree/part/migrations/0067_partinternalpricebreak.py @@ -26,6 +26,7 @@ class Migration(migrations.Migration): ], options={ 'unique_together': {('part', 'quantity')}, + 'verbose_name': 'Part Internal Price Break', }, ), ] diff --git a/src/backend/InvenTree/part/models.py b/src/backend/InvenTree/part/models.py index 3c89656c7e..4ff09c9b6b 100644 --- a/src/backend/InvenTree/part/models.py +++ b/src/backend/InvenTree/part/models.py @@ -3599,6 +3599,7 @@ class PartInternalPriceBreak(common.models.PriceBreak): """Metaclass providing extra model definition.""" unique_together = ('part', 'quantity') + verbose_name = _('Part Internal Price Break') @staticmethod def get_api_url(): diff --git a/src/backend/InvenTree/part/serializers.py b/src/backend/InvenTree/part/serializers.py index 0e62494f88..dae1f796f0 100644 --- a/src/backend/InvenTree/part/serializers.py +++ b/src/backend/InvenTree/part/serializers.py @@ -276,7 +276,10 @@ class PartSalePriceSerializer( ) -class PartInternalPriceSerializer(InvenTree.serializers.InvenTreeModelSerializer): +@register_importer() +class PartInternalPriceSerializer( + DataImportExportSerializerMixin, InvenTree.serializers.InvenTreeModelSerializer +): """Serializer for internal prices for Part model.""" class Meta: diff --git a/src/frontend/src/pages/part/pricing/PriceBreakPanel.tsx b/src/frontend/src/pages/part/pricing/PriceBreakPanel.tsx index c0baeed909..7c7f4e308e 100644 --- a/src/frontend/src/pages/part/pricing/PriceBreakPanel.tsx +++ b/src/frontend/src/pages/part/pricing/PriceBreakPanel.tsx @@ -161,7 +161,8 @@ export default function PriceBreakPanel({ part: part.pk }, tableActions: tableActions, - rowActions: rowActions + rowActions: rowActions, + enableDownload: true }} /> {table.records.length > 0 ? ( diff --git a/src/frontend/src/pages/part/pricing/SupplierPricingPanel.tsx b/src/frontend/src/pages/part/pricing/SupplierPricingPanel.tsx index f77a73b9c6..e63f7044ed 100644 --- a/src/frontend/src/pages/part/pricing/SupplierPricingPanel.tsx +++ b/src/frontend/src/pages/part/pricing/SupplierPricingPanel.tsx @@ -55,7 +55,8 @@ export default function SupplierPricingPanel({ base_part: part.pk, supplier_detail: true, part_detail: true - } + }, + enableDownload: true }} /> {supplierPricingData.length > 0 ? (