Merge branch 'inventree:master' into matmair/issue2210

This commit is contained in:
Matthias Mair 2021-10-30 17:23:55 +02:00 committed by GitHub
commit 6ce10736af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,7 +83,9 @@ class POLineItemResource(ModelResource):
class SOLineItemResource(ModelResource):
""" Class for managing import / export of SOLineItem data """
"""
Class for managing import / export of SOLineItem data
"""
part_name = Field(attribute='part__name', readonly=True)
@ -93,6 +95,17 @@ class SOLineItemResource(ModelResource):
fulfilled = Field(attribute='fulfilled_quantity', readonly=True)
def dehydrate_sale_price(self, item):
"""
Return a string value of the 'sale_price' field, rather than the 'Money' object.
Ref: https://github.com/inventree/InvenTree/issues/2207
"""
if item.sale_price:
return str(item.sale_price)
else:
return ''
class Meta:
model = SalesOrderLineItem
skip_unchanged = True