Add invoice management

This commit is contained in:
Edgar P. Burkhart 2022-05-19 21:21:55 +02:00
parent 5339a725f2
commit 6ef5a441e1
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
4 changed files with 44 additions and 6 deletions

View file

@ -28,3 +28,13 @@ class Invoice(models.Model):
def __str__(self):
return f"{self.name}: {self.transaction}"
def delete(self, *args, **kwargs):
self.file.delete()
super().delete(*args, **kwargs)
class InvoiceForm(ModelForm):
class Meta:
model = Invoice
fields = ["name", "file"]