diff --git a/kfet/forms.py b/kfet/forms.py index 9419d9f8..cca3f8c5 100644 --- a/kfet/forms.py +++ b/kfet/forms.py @@ -288,6 +288,8 @@ class ArticleForm(forms.ModelForm): "hidden", "price", "stock", + "abv", + "volume", "category", "box_type", "box_capacity", @@ -301,6 +303,8 @@ class ArticleRestrictForm(ArticleForm): "is_sold", "hidden", "price", + "abv", + "volume", "category", "box_type", "box_capacity", diff --git a/kfet/migrations/0072_auto_20200515_1747.py b/kfet/migrations/0072_auto_20200515_1747.py new file mode 100644 index 00000000..7dbe2a95 --- /dev/null +++ b/kfet/migrations/0072_auto_20200515_1747.py @@ -0,0 +1,33 @@ +# Generated by Django 2.2.12 on 2020-05-15 15:47 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("kfet", "0071_promo_2020"), + ] + + operations = [ + migrations.AddField( + model_name="article", + name="abv", + field=models.DecimalField( + decimal_places=1, + default=0, + max_digits=6, + verbose_name="Degré d'alcool (en %)", + ), + ), + migrations.AddField( + model_name="article", + name="volume", + field=models.DecimalField( + decimal_places=1, + default=0, + max_digits=6, + verbose_name="Volume d'une unité (en cL)", + ), + ), + ] diff --git a/kfet/models.py b/kfet/models.py index 2eacf06f..cee80705 100644 --- a/kfet/models.py +++ b/kfet/models.py @@ -520,6 +520,13 @@ class Article(models.Model): "capacité du contenant", blank=True, null=True, default=None ) + abv = models.DecimalField( + _("Degré d'alcool (en %)"), max_digits=6, default=0, decimal_places=1 + ) + volume = models.DecimalField( + _("Volume d'une unité (en cL)"), max_digits=6, default=0, decimal_places=1 + ) + def __str__(self): return "%s - %s" % (self.category.name, self.name)