Bug fix for PurchaseOrderCancelSerializer (#7943)

- Fix duplication of "self.order" property
This commit is contained in:
Oliver 2024-08-21 15:45:58 +10:00 committed by GitHub
parent e837e5d7d7
commit 7709d8df70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -319,12 +319,6 @@ class PurchaseOrderHoldSerializer(OrderAdjustSerializer):
class PurchaseOrderCancelSerializer(OrderAdjustSerializer):
"""Serializer for cancelling a PurchaseOrder."""
def get_context_data(self):
"""Return custom context information about the order."""
self.order = self.context['order']
return {'can_cancel': self.order.can_cancel}
def save(self):
"""Save the serializer to 'cancel' the order."""
if not self.order.can_cancel: