2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 03:30:54 +00:00

Add a 'full_name' field for Part

- Combines IPN | Name | Variant
- Use this to display in most views
This commit is contained in:
Oliver Walters
2019-05-12 12:16:04 +10:00
parent 08d743a735
commit 1d36ea3e2e
35 changed files with 81 additions and 78 deletions

View File

@ -180,7 +180,7 @@ class StockItem(models.Model):
reverse('api-stock-detail', kwargs={'pk': self.id}),
{
'part_id': self.part.id,
'part_name': self.part.name
'part_name': self.part.full_name
}
)
@ -464,7 +464,7 @@ class StockItem(models.Model):
def __str__(self):
s = '{n} x {part}'.format(
n=self.quantity,
part=self.part.name)
part=self.part.full_name)
if self.location:
s += ' @ {loc}'.format(loc=self.location.name)