mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Fix bug relating no PurchaseOrderLineItem with null Part reference
This commit is contained in:
parent
4b6ca548b6
commit
6a995042c9
@ -747,8 +747,15 @@ class PurchaseOrderLineItem(OrderLineItem):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def get_base_part(self):
|
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?
|
# TODO - Function callback for when the SupplierPart is deleted?
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user