Add default date on snapshots

This commit is contained in:
Edgar P. Burkhart 2022-12-21 09:21:17 +01:00
parent 495c64fcdc
commit 7895210aea
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -117,7 +117,7 @@ class InvoiceForm(ModelForm):
class Snapshot(models.Model):
id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False)
date = models.DateField(unique=True, verbose_name=_("Date"))
date = models.DateField(default=date.today, unique=True, verbose_name=_("Date"))
value = models.DecimalField(
max_digits=12, decimal_places=2, default=0, verbose_name=_("Value")
)