diff --git a/InvenTree/order/models.py b/InvenTree/order/models.py index 99c71d1c3e..248ecb277d 100644 --- a/InvenTree/order/models.py +++ b/InvenTree/order/models.py @@ -747,8 +747,15 @@ class PurchaseOrderLineItem(OrderLineItem): ) def get_base_part(self): - """ Return the base-part for the line item """ - return self.part.part + """ + Return the base part.Part object for the line item + + Note: Returns None if the SupplierPart is not set! + """ + if self.part is None: + return None + else: + return self.part.part # TODO - Function callback for when the SupplierPart is deleted?