2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 18:15:40 +00:00

Add form for selecting label template for a StockItem

This commit is contained in:
Oliver Walters
2020-08-16 12:10:58 +10:00
parent 30e24f19d9
commit 1807ba4e7b
5 changed files with 95 additions and 0 deletions

View File

@ -43,6 +43,12 @@ class LabelTemplate(models.Model):
def template(self):
return self.label.path
def __str__(self):
return "{n} - {d}".format(
n=self.name,
d=self.description
)
name = models.CharField(
unique=True,
blank=False, max_length=100,
@ -137,6 +143,7 @@ class StockItemLabel(LabelTemplate):
'uid': item.uid,
'pk': item.pk,
'qr_data': item.format_short_barcode(),
'tests': item.testResultMap()
})
return records