2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-12 10:05:39 +00:00

Ability to delete part

- Provides confirmation form
- Shows the flow-on effects (model.CASCADE) from deleting this part
- Bootstrap makes it prettyful
This commit is contained in:
Oliver
2018-04-15 08:45:50 +10:00
parent 21e3f415c6
commit 54e78bf468
7 changed files with 109 additions and 9 deletions

View File

@ -77,12 +77,14 @@ class Part(models.Model):
return '/part/{id}/'.format(id=self.id)
# Short name of the part
name = models.CharField(max_length=100)
name = models.CharField(max_length=100, unique=True)
# Longer description of the part (optional)
description = models.CharField(max_length=250, blank=True)
# Internal Part Number (optional)
# Potentially multiple parts map to the same internal IPN (variants?)
# So this does not have to be unique
IPN = models.CharField(max_length=100, blank=True)
# Provide a URL for an external link
@ -117,7 +119,7 @@ class Part(models.Model):
class Meta:
verbose_name = "Part"
verbose_name_plural = "Parts"
unique_together = (("name", "category"),)
#unique_together = (("name", "category"),)
@property
def stock(self):