2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-06 20:11:37 +00:00

Add function to make barcode for build order

This commit is contained in:
Oliver Walters
2021-02-17 13:47:14 +11:00
parent 98bd7dfa9a
commit 08cc866e74
3 changed files with 16 additions and 1 deletions

View File

@@ -65,6 +65,20 @@ class Build(MPTTModel):
verbose_name = _("Build Order")
verbose_name_plural = _("Build Orders")
def format_barcode(self, **kwargs):
"""
Return a JSON string to represent this build as a barcode
"""
return helpers.MakeBarcode(
"buildorder",
self.pk,
{
"reference": self.title,
"url": self.get_absolute_url(),
}
)
@staticmethod
def filterByDate(queryset, min_date, max_date):
"""