mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add function to make barcode for build order
This commit is contained in:
parent
98bd7dfa9a
commit
08cc866e74
@ -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):
|
||||
"""
|
||||
|
@ -4,6 +4,7 @@
|
||||
{% load report %}
|
||||
{% load inventree_extras %}
|
||||
{% load markdownify %}
|
||||
{% load qr_code %}
|
||||
|
||||
{% block page_margin %}
|
||||
margin: 2cm;
|
||||
|
@ -110,7 +110,7 @@ class StockTest(TestCase):
|
||||
# The "is_building" quantity should not be counted here
|
||||
self.assertEqual(part.total_stock, n + 5)
|
||||
|
||||
self.assertEqual(part.quantity_being_built, 100)
|
||||
self.assertEqual(part.quantity_being_built, 1)
|
||||
|
||||
def test_loc_count(self):
|
||||
self.assertEqual(StockLocation.objects.count(), 7)
|
||||
|
Loading…
Reference in New Issue
Block a user