Fix bug relating no PurchaseOrderLineItem with null Part reference

This commit is contained in:
Oliver 2021-07-09 12:10:17 +10:00
parent 4b6ca548b6
commit 6a995042c9

View File

@ -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?