mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Stock: Fix serializers.py
- Use of read_only PrimaryKeyRelatedField was breaking POST via API
This commit is contained in:
parent
fa540c0096
commit
8615cad711
@ -186,7 +186,7 @@ class StockCount(StockAdjust):
|
||||
|
||||
class StockAdd(StockAdjust):
|
||||
"""
|
||||
Endpoint for adding stock
|
||||
Endpoint for adding a quantity of stock to an existing StockItem
|
||||
"""
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
@ -204,7 +204,7 @@ class StockAdd(StockAdjust):
|
||||
|
||||
class StockRemove(StockAdjust):
|
||||
"""
|
||||
Endpoint for removing stock.
|
||||
Endpoint for removing a quantity of stock from an existing StockItem.
|
||||
"""
|
||||
|
||||
def post(self, request, *args, **kwargs):
|
||||
|
@ -99,26 +99,10 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
||||
|
||||
return queryset
|
||||
|
||||
belongs_to = serializers.PrimaryKeyRelatedField(read_only=True)
|
||||
|
||||
build_order = serializers.PrimaryKeyRelatedField(read_only=True)
|
||||
|
||||
customer = serializers.PrimaryKeyRelatedField(read_only=True)
|
||||
|
||||
location = serializers.PrimaryKeyRelatedField(read_only=True)
|
||||
|
||||
in_stock = serializers.BooleanField(read_only=True)
|
||||
|
||||
sales_order = serializers.PrimaryKeyRelatedField(read_only=True)
|
||||
|
||||
status_text = serializers.CharField(source='get_status_display', read_only=True)
|
||||
|
||||
supplier_part = serializers.PrimaryKeyRelatedField(read_only=True)
|
||||
|
||||
|
||||
supplier_part_detail = SupplierPartSerializer(source='supplier_part', many=False, read_only=True)
|
||||
|
||||
part = serializers.PrimaryKeyRelatedField(read_only=True)
|
||||
|
||||
part_detail = PartBriefSerializer(source='part', many=False, read_only=True)
|
||||
|
||||
location_detail = LocationBriefSerializer(source='location', many=False, read_only=True)
|
||||
|
@ -24,4 +24,5 @@ django-stdimage==5.1.1 # Advanced ImageField management
|
||||
django-tex==1.1.7 # LaTeX PDF export
|
||||
django-weasyprint==1.0.1 # HTML PDF export
|
||||
django-debug-toolbar==2.2 # Debug / profiling toolbar
|
||||
|
||||
inventree # Install the latest version of the InvenTree API python library
|
Loading…
Reference in New Issue
Block a user