def format_barcode(self): """ Return a JSON string for formatting a barcode for this StockLocation object """ return helpers.MakeBarcode( 'StockLocation', self.id, reverse('api-location-detail', kwargs={'pk': self.id}), { 'name': self.name, })
def format_barcode(self): """ Return a JSON string for formatting a barcode for this Part object """ return helpers.MakeBarcode( "Part", self.id, reverse('api-part-detail', kwargs={'pk': self.id}), { 'name': self.name, })
def format_barcode(self, **kwargs): """ Return a JSON string for formatting a barcode for this StockLocation object """ return helpers.MakeBarcode( 'stocklocation', self.pk, { "name": self.name, "url": reverse('api-location-detail', kwargs={'pk': self.id}), }, **kwargs)
def format_barcode(self): """ Return a JSON string for formatting a barcode for this Part object """ return helpers.MakeBarcode( "part", { "id": self.id, "name": self.full_name, "url": reverse('api-part-detail', kwargs={'pk': self.id}), })
def format_barcode(self, **kwargs): """ Return a JSON string for formatting a barcode for this StockItem. Can be used to perform lookup of a stockitem using barcode Contains the following data: { type: 'StockItem', stock_id: <pk>, part_id: <part_pk> } Voltagile data (e.g. stock quantity) should be looked up using the InvenTree API (as it may change) """ return helpers.MakeBarcode( "stockitem", self.id, { "url": reverse('api-stock-detail', kwargs={'pk': self.id}), }, **kwargs)