mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Add "brief" version of QR codes
- Use this to render to labels (as it contains much less information)
This commit is contained in:
		@@ -283,7 +283,7 @@ class StockItem(MPTTModel):
 | 
			
		||||
    def get_part_name(self):
 | 
			
		||||
        return self.part.full_name
 | 
			
		||||
 | 
			
		||||
    def format_barcode(self):
 | 
			
		||||
    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
 | 
			
		||||
 | 
			
		||||
@@ -296,19 +296,14 @@ class StockItem(MPTTModel):
 | 
			
		||||
 | 
			
		||||
        return helpers.MakeBarcode(
 | 
			
		||||
            "stockitem",
 | 
			
		||||
            self.id,
 | 
			
		||||
            {
 | 
			
		||||
                "id": self.id,
 | 
			
		||||
                "url": reverse('api-stock-detail', kwargs={'pk': self.id}),
 | 
			
		||||
            }
 | 
			
		||||
            },
 | 
			
		||||
            **kwargs
 | 
			
		||||
        )
 | 
			
		||||
 | 
			
		||||
    def format_short_barcode(self):
 | 
			
		||||
        """
 | 
			
		||||
        Return a short barcode
 | 
			
		||||
        """
 | 
			
		||||
 | 
			
		||||
        return "stockid={pk}".format(pk=self.pk)
 | 
			
		||||
 | 
			
		||||
    uid = models.CharField(blank=True, max_length=128, help_text=("Unique identifier field"))
 | 
			
		||||
 | 
			
		||||
    parent = TreeForeignKey(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user