2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-20 03:36:30 +00:00

Merge pull request from SchrodingersGat/barcode

Create simple endpoint for barcode decode
This commit is contained in:
Oliver
2020-04-16 21:55:24 +10:00
committed by GitHub
29 changed files with 646 additions and 58 deletions

@@ -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