2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 19:15:41 +00:00

Add barcode to salesordershipment (#9745)

* Add InvenTreeBarcodeMixin to SalesOrderShipment

* Barcode model type code method added for SalesOrderShipment class

* Add barcode data to SalesOrderShipment serializer

* Bump API version

---------

Co-authored-by: meenaraj22 <meena@blaze.ws>
Co-authored-by: Matthias Mair <code@mjmair.com>
This commit is contained in:
Oliver
2025-06-07 15:51:05 +10:00
committed by GitHub
parent e17904eb56
commit 66db58bb36
4 changed files with 34 additions and 1 deletions

View File

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

View File

@ -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'),
),
]

View File

@ -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."""

View File

@ -1304,6 +1304,7 @@ class SalesOrderShipmentSerializer(NotesFieldMixin, InvenTreeModelSerializer):
'reference',
'tracking_number',
'invoice_number',
'barcode_hash',
'link',
'notes',
]