Skip to content

Commit

Permalink
Shipment Attachments (#8231)
Browse files Browse the repository at this point in the history
Create shipment attachments on parent order.
  • Loading branch information
fuzeman authored Oct 2, 2024
1 parent 5759b60 commit 69bc580
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/backend/InvenTree/InvenTree/api_version.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
"""InvenTree API version information."""

# InvenTree API version
INVENTREE_API_VERSION = 263
INVENTREE_API_VERSION = 264

"""Increment this API version number whenever there is a significant change to the API that any clients need to know about."""


INVENTREE_API_TEXT = """
264 - 2024-10-03 : https://github.com/inventree/InvenTree/pull/8231
- Adds Sales Order Shipment attachment model type
263 - 2024-09-30 : https://github.com/inventree/InvenTree/pull/8194
- Adds Sales Order Shipment report
Expand Down
8 changes: 8 additions & 0 deletions src/backend/InvenTree/order/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,7 @@ def is_completed(self):


class SalesOrderShipment(
InvenTree.models.InvenTreeAttachmentMixin,
InvenTree.models.InvenTreeNotesMixin,
report.mixins.InvenTreeReportMixin,
InvenTree.models.MetadataMixin,
Expand Down Expand Up @@ -1921,6 +1922,13 @@ def complete_shipment(self, user, **kwargs):

trigger_event('salesordershipment.completed', id=self.pk)

def create_attachment(self, *args, **kwargs):
"""Create an attachment / link on parent order.
This will only be called when a generated report should be attached to this instance.
"""
return self.order.create_attachment(*args, **kwargs)


class SalesOrderExtraLine(OrderExtraLine):
"""Model for a single ExtraLine in a SalesOrder.
Expand Down

0 comments on commit 69bc580

Please sign in to comment.