Add invoice management
This commit is contained in:
parent
5339a725f2
commit
6ef5a441e1
4 changed files with 44 additions and 6 deletions
|
@ -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"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue