WIP: Affiche un warning si trop d'alcool consommé #727
3 changed files with 44 additions and 0 deletions
|
@ -288,6 +288,8 @@ class ArticleForm(forms.ModelForm):
|
||||||
"hidden",
|
"hidden",
|
||||||
"price",
|
"price",
|
||||||
"stock",
|
"stock",
|
||||||
|
"abv",
|
||||||
|
"volume",
|
||||||
"category",
|
"category",
|
||||||
"box_type",
|
"box_type",
|
||||||
"box_capacity",
|
"box_capacity",
|
||||||
|
@ -301,6 +303,8 @@ class ArticleRestrictForm(ArticleForm):
|
||||||
"is_sold",
|
"is_sold",
|
||||||
"hidden",
|
"hidden",
|
||||||
"price",
|
"price",
|
||||||
|
"abv",
|
||||||
|
"volume",
|
||||||
"category",
|
"category",
|
||||||
"box_type",
|
"box_type",
|
||||||
"box_capacity",
|
"box_capacity",
|
||||||
|
|
33
kfet/migrations/0072_auto_20200515_1747.py
Normal file
33
kfet/migrations/0072_auto_20200515_1747.py
Normal file
|
@ -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)",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]
|
|
@ -520,6 +520,13 @@ class Article(models.Model):
|
||||||
"capacité du contenant", blank=True, null=True, default=None
|
"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):
|
def __str__(self):
|
||||||
return "%s - %s" % (self.category.name, self.name)
|
return "%s - %s" % (self.category.name, self.name)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue