mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Add 'barcode_hash' data to more API serializers: (#3906)
* Add 'barcode_hash' data to more API serializers: - part - stock location - supplier part * Bump API version * Make 'barcode_hash' fields read-only via the API * Fix for Part serializer
This commit is contained in:
@ -285,6 +285,7 @@ class PartBriefSerializer(InvenTreeModelSerializer):
|
||||
fields = [
|
||||
'pk',
|
||||
'IPN',
|
||||
'barcode_hash',
|
||||
'default_location',
|
||||
'name',
|
||||
'revision',
|
||||
@ -301,6 +302,10 @@ class PartBriefSerializer(InvenTreeModelSerializer):
|
||||
'units',
|
||||
]
|
||||
|
||||
read_only_fields = [
|
||||
'barcode_hash',
|
||||
]
|
||||
|
||||
|
||||
class PartSerializer(RemoteImageMixin, InvenTreeModelSerializer):
|
||||
"""Serializer for complete detail information of a part.
|
||||
@ -430,6 +435,7 @@ class PartSerializer(RemoteImageMixin, InvenTreeModelSerializer):
|
||||
'allocated_to_build_orders',
|
||||
'allocated_to_sales_orders',
|
||||
'assembly',
|
||||
'barcode_hash',
|
||||
'category',
|
||||
'category_detail',
|
||||
'component',
|
||||
@ -467,6 +473,10 @@ class PartSerializer(RemoteImageMixin, InvenTreeModelSerializer):
|
||||
'virtual',
|
||||
]
|
||||
|
||||
read_only_fields = [
|
||||
'barcode_hash',
|
||||
]
|
||||
|
||||
def save(self):
|
||||
"""Save the Part instance"""
|
||||
|
||||
|
Reference in New Issue
Block a user