mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 03:00:54 +00:00
Fix for #1661
This commit is contained in:
@ -161,6 +161,13 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
||||
|
||||
required_tests = serializers.IntegerField(source='required_test_count', read_only=True, required=False)
|
||||
|
||||
purchase_price = serializers.SerializerMethodField()
|
||||
|
||||
def get_purchase_price(self, obj):
|
||||
""" Return purchase_price (Money field) as string (includes currency) """
|
||||
|
||||
return str(obj.purchase_price) if obj.purchase_price else '-'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
||||
part_detail = kwargs.pop('part_detail', False)
|
||||
@ -215,6 +222,7 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
||||
'tracking_items',
|
||||
'uid',
|
||||
'updated',
|
||||
'purchase_price',
|
||||
]
|
||||
|
||||
""" These fields are read-only in this context.
|
||||
|
Reference in New Issue
Block a user