mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-12 06:40:53 +00:00
Add unit testing framework for barcodes
This commit is contained in:
@@ -50,6 +50,18 @@ class BarcodePlugin:
|
||||
|
||||
return None
|
||||
|
||||
def getStockItemByHash(self):
|
||||
"""
|
||||
Attempt to retrieve a StockItem associated with this barcode,
|
||||
based on the barcode hash.
|
||||
"""
|
||||
|
||||
try:
|
||||
item = StockItem.objects.get(uid=self.hash())
|
||||
return item
|
||||
except StockItem.DoesNotExist:
|
||||
return None
|
||||
|
||||
def renderStockItem(self, item):
|
||||
"""
|
||||
Render a stock item to JSON response
|
||||
|
Reference in New Issue
Block a user