2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-29 20:16:44 +00:00

Shipment Attachments (#8231)

Create shipment attachments on parent order.
This commit is contained in:
Dean 2024-10-03 11:31:38 +13:00 committed by GitHub
parent 5759b60a48
commit 69bc5808d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 1 deletions

View File

@ -1,13 +1,16 @@
"""InvenTree API version information.""" """InvenTree API version information."""
# InvenTree API version # 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.""" """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 = """
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 263 - 2024-09-30 : https://github.com/inventree/InvenTree/pull/8194
- Adds Sales Order Shipment report - Adds Sales Order Shipment report

View File

@ -1738,6 +1738,7 @@ class SalesOrderLineItem(OrderLineItem):
class SalesOrderShipment( class SalesOrderShipment(
InvenTree.models.InvenTreeAttachmentMixin,
InvenTree.models.InvenTreeNotesMixin, InvenTree.models.InvenTreeNotesMixin,
report.mixins.InvenTreeReportMixin, report.mixins.InvenTreeReportMixin,
InvenTree.models.MetadataMixin, InvenTree.models.MetadataMixin,
@ -1921,6 +1922,13 @@ class SalesOrderShipment(
trigger_event('salesordershipment.completed', id=self.pk) 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): class SalesOrderExtraLine(OrderExtraLine):
"""Model for a single ExtraLine in a SalesOrder. """Model for a single ExtraLine in a SalesOrder.