Skip to content

Commit

Permalink
Shipment Attachments
Browse files Browse the repository at this point in the history
Create shipment attachments on parent order.
  • Loading branch information
fuzeman committed Oct 2, 2024
1 parent 5759b60 commit d24375c
Showing 1 changed file with 8 additions and 0 deletions.
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 d24375c

Please sign in to comment.