Import internal price (#12341)

* Enable download from frontend panels

* Enable data import for part internal pricing

* Bump API version

* Update CHANGELOG
This commit is contained in:
Oliver
2026-07-09 23:17:41 +10:00
committed by GitHub
parent 996dbc5aa8
commit c9d98cb545
7 changed files with 15 additions and 4 deletions
+1
View File
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### 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 - [#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 - [#12250](https://github.com/inventree/InvenTree/pull/12250) adds "active" field to the ProjectCode model and API endpoints
@@ -1,11 +1,14 @@
"""InvenTree API version information.""" """InvenTree API version information."""
# InvenTree API version # 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.""" """Increment this API version number whenever there is a significant change to the API that any clients need to know about."""
INVENTREE_API_TEXT = """ 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 v517 -> 2026-07-08 : https://github.com/inventree/InvenTree/pull/12336
- Fix currency code options for the PartPricing model and API endpoints - Fix currency code options for the PartPricing model and API endpoints
@@ -26,6 +26,7 @@ class Migration(migrations.Migration):
], ],
options={ options={
'unique_together': {('part', 'quantity')}, 'unique_together': {('part', 'quantity')},
'verbose_name': 'Part Internal Price Break',
}, },
), ),
] ]
+1
View File
@@ -3599,6 +3599,7 @@ class PartInternalPriceBreak(common.models.PriceBreak):
"""Metaclass providing extra model definition.""" """Metaclass providing extra model definition."""
unique_together = ('part', 'quantity') unique_together = ('part', 'quantity')
verbose_name = _('Part Internal Price Break')
@staticmethod @staticmethod
def get_api_url(): def get_api_url():
+4 -1
View File
@@ -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.""" """Serializer for internal prices for Part model."""
class Meta: class Meta:
@@ -161,7 +161,8 @@ export default function PriceBreakPanel({
part: part.pk part: part.pk
}, },
tableActions: tableActions, tableActions: tableActions,
rowActions: rowActions rowActions: rowActions,
enableDownload: true
}} }}
/> />
{table.records.length > 0 ? ( {table.records.length > 0 ? (
@@ -55,7 +55,8 @@ export default function SupplierPricingPanel({
base_part: part.pk, base_part: part.pk,
supplier_detail: true, supplier_detail: true,
part_detail: true part_detail: true
} },
enableDownload: true
}} }}
/> />
{supplierPricingData.length > 0 ? ( {supplierPricingData.length > 0 ? (