2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-13 08:21:26 +00:00

Add part detail page for company / supplier

This commit is contained in:
Oliver
2018-04-22 23:07:23 +10:00
parent 4ebd8cd6b1
commit ac3de4ce3d
7 changed files with 57 additions and 8 deletions

View File

@ -403,6 +403,18 @@ class SupplierPart(models.Model):
# lead time for parts that cannot be delivered immediately
lead_time = models.DurationField(blank=True, null=True)
@property
def manufacturer_string(self):
items = []
if self.manufacturer:
items.append(self.manufacturer)
if self.MPN:
items.append(self.MPN)
return ' | '.join(items)
def __str__(self):
return "{sku} - {supplier}".format(
sku=self.SKU,