2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-08 12:50:55 +00:00

Fixes for barcode data rendering

This commit is contained in:
Oliver Walters
2020-08-16 13:39:05 +10:00
parent 2bbc65cc59
commit a4267f76e8
4 changed files with 12 additions and 7 deletions

View File

@@ -560,16 +560,17 @@ class Part(MPTTModel):
responsible = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True, related_name='parts_responible')
def format_barcode(self):
def format_barcode(self, **kwargs):
""" Return a JSON string for formatting a barcode for this Part object """
return helpers.MakeBarcode(
"part",
self.id,
{
"id": self.id,
"name": self.full_name,
"url": reverse('api-part-detail', kwargs={'pk': self.id}),
}
},
**kwargs
)
@property