2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-08-10 05:40:55 +00:00

Save the selected BOM data

This commit is contained in:
Oliver Walters
2019-07-10 12:27:19 +10:00
parent c2dbc37f70
commit 482a5dae4b
2 changed files with 38 additions and 3 deletions

View File

@@ -671,6 +671,13 @@ class Part(models.Model):
self.save()
@transaction.atomic
def clear_bom(self):
""" Clear the BOM items for the part (delete all BOM lines).
"""
self.bom_items.all().delete()
def required_parts(self):
""" Return a list of parts required to make this part (list of BOM items) """
parts = []