Handle purchase price export for .xls files (#5362)

This commit is contained in:
Oliver 2023-07-28 15:28:50 +10:00 committed by GitHub
parent 5f3d3b28b3
commit 87da286f2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -171,6 +171,14 @@ class PurchaseOrderLineItemResource(PriceResourceMixin, InvenTreeResource):
SKU = Field(attribute='part__SKU', readonly=True)
def dehydrate_purchase_price(self, line):
"""Return a string value of the 'purchase_price' field, rather than the 'Money' object"""
if line.purchase_price:
return line.purchase_price.amount
else:
return ''
class PurchaseOrderExtraLineResource(PriceResourceMixin, InvenTreeResource):
"""Class for managing import / export of PurchaseOrderExtraLine data."""