mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-20 03:36:30 +00:00
Merge pull request #722 from SchrodingersGat/barcode
Create simple endpoint for barcode decode
This commit is contained in:
InvenTree
InvenTree
company
templates
company
order
part
plugins
stock
@@ -478,11 +478,11 @@ class Part(models.Model):
|
||||
""" Return a JSON string for formatting a barcode for this Part object """
|
||||
|
||||
return helpers.MakeBarcode(
|
||||
"Part",
|
||||
self.id,
|
||||
reverse('api-part-detail', kwargs={'pk': self.id}),
|
||||
"part",
|
||||
{
|
||||
'name': self.name,
|
||||
"id": self.id,
|
||||
"name": self.full_name,
|
||||
"url": reverse('api-part-detail', kwargs={'pk': self.id}),
|
||||
}
|
||||
)
|
||||
|
||||
|
@@ -96,6 +96,8 @@ class PartSerializer(InvenTreeModelSerializer):
|
||||
queryset = queryset.prefetch_related('builds')
|
||||
return queryset
|
||||
|
||||
# TODO - Include a 'category_detail' field which serializers the category object
|
||||
|
||||
class Meta:
|
||||
model = Part
|
||||
partial = True
|
||||
|
Reference in New Issue
Block a user