2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-28 23:51:34 +00:00

Add view for BomItem model

- Create BOM item (auto-add to a parent part)
- Edit / delete
- View details
This commit is contained in:
Oliver
2018-04-15 21:29:24 +10:00
parent 0632609a80
commit 5861296974
10 changed files with 136 additions and 5 deletions

@@ -201,6 +201,9 @@ class BomItem(models.Model):
which parts are required (and in what quatity) to make it
"""
def get_absolute_url(self):
return '/part/bom/{id}/'.format(id=self.id)
# A link to the parent part
# Each part will get a reverse lookup field 'bom_items'
part = models.ForeignKey(Part, on_delete=models.CASCADE, related_name='bom_items')