diff --git a/src/backend/InvenTree/InvenTree/api_version.py b/src/backend/InvenTree/InvenTree/api_version.py index 48f2be900d..b8446ff0b5 100644 --- a/src/backend/InvenTree/InvenTree/api_version.py +++ b/src/backend/InvenTree/InvenTree/api_version.py @@ -1,12 +1,15 @@ """InvenTree API version information.""" # InvenTree API version -INVENTREE_API_VERSION = 344 +INVENTREE_API_VERSION = 345 """Increment this API version number whenever there is a significant change to the API that any clients need to know about.""" INVENTREE_API_TEXT = """ +v345 -> 2025-06-07 : https://github.com/inventree/InvenTree/pull/9745 + - Adds barcode information to SalesOrderShipment API endpoint + v344 -> 2025-06-02 : https://github.com/inventree/InvenTree/pull/9714 - Updates alauth version and adds device trust as a factor diff --git a/src/backend/InvenTree/order/migrations/0110_salesordershipment_barcode_data_and_more.py b/src/backend/InvenTree/order/migrations/0110_salesordershipment_barcode_data_and_more.py new file mode 100644 index 0000000000..028c64fbcd --- /dev/null +++ b/src/backend/InvenTree/order/migrations/0110_salesordershipment_barcode_data_and_more.py @@ -0,0 +1,23 @@ +# Generated by Django 4.2.20 on 2025-04-11 06:37 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('order', '0109_salesorder_issue_date'), + ] + + operations = [ + migrations.AddField( + model_name='salesordershipment', + name='barcode_data', + field=models.CharField(blank=True, help_text='Third party barcode data', max_length=500, verbose_name='Barcode Data'), + ), + migrations.AddField( + model_name='salesordershipment', + name='barcode_hash', + field=models.CharField(blank=True, help_text='Unique hash of barcode data', max_length=128, verbose_name='Barcode Hash'), + ), + ] diff --git a/src/backend/InvenTree/order/models.py b/src/backend/InvenTree/order/models.py index f726cd1619..96fa7f1b52 100644 --- a/src/backend/InvenTree/order/models.py +++ b/src/backend/InvenTree/order/models.py @@ -1951,6 +1951,7 @@ class SalesOrderShipmentReportContext(report.mixins.BaseReportContext): class SalesOrderShipment( InvenTree.models.InvenTreeAttachmentMixin, + InvenTree.models.InvenTreeBarcodeMixin, InvenTree.models.InvenTreeNotesMixin, report.mixins.InvenTreeReportMixin, InvenTree.models.MetadataMixin, @@ -1970,6 +1971,11 @@ class SalesOrderShipment( notes: Custom notes field for this shipment """ + @classmethod + def barcode_model_type_code(cls): + """Return the associated barcode model type code for this model.""" + return 'SS' + class Meta: """Metaclass defines extra model options.""" diff --git a/src/backend/InvenTree/order/serializers.py b/src/backend/InvenTree/order/serializers.py index 2b9d81363b..9cada9a8a4 100644 --- a/src/backend/InvenTree/order/serializers.py +++ b/src/backend/InvenTree/order/serializers.py @@ -1304,6 +1304,7 @@ class SalesOrderShipmentSerializer(NotesFieldMixin, InvenTreeModelSerializer): 'reference', 'tracking_number', 'invoice_number', + 'barcode_hash', 'link', 'notes', ]