2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

Further barcode work

- Simplify InvenTree barcode format
- Create base-clas for plugin
This commit is contained in:
Oliver Walters
2020-04-14 21:30:43 +10:00
parent 70589b06e1
commit 4a615e05ae
9 changed files with 127 additions and 49 deletions

View File

@ -44,11 +44,11 @@ class StockLocation(InvenTreeTree):
""" Return a JSON string for formatting a barcode for this StockLocation object """
return helpers.MakeBarcode(
'StockLocation',
self.id,
reverse('api-location-detail', kwargs={'pk': self.id}),
'stocklocation',
{
'name': self.name,
"id": self.id,
"name": self.name,
"url": reverse('api-location-detail', kwargs={'pk': self.id}),
}
)
@ -288,12 +288,10 @@ class StockItem(MPTTModel):
"""
return helpers.MakeBarcode(
'StockItem',
self.id,
reverse('api-stock-detail', kwargs={'pk': self.id}),
"stockitem",
{
'part_id': self.part.id,
'part_name': self.part.full_name
"id": self.id,
"url": reverse('api-stock-detail', kwargs={'pk': self.id}),
}
)