mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-21 01:48:21 +02:00
[invoices] Quantities can be non-integers
Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
@ -5,6 +5,7 @@ from datetime import date
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.exceptions import ValidationError
|
||||
from django.core.validators import MinValueValidator
|
||||
from django.db import models, transaction
|
||||
from django.db.models import Q
|
||||
from django.template.loader import render_to_string
|
||||
@ -131,12 +132,13 @@ class Product(models.Model):
|
||||
verbose_name=_("Designation"),
|
||||
)
|
||||
|
||||
quantity = models.PositiveIntegerField(
|
||||
verbose_name=_("Quantity")
|
||||
quantity = models.FloatField(
|
||||
verbose_name=_("Quantity"),
|
||||
validators=[MinValueValidator(0)],
|
||||
)
|
||||
|
||||
amount = models.IntegerField(
|
||||
verbose_name=_("Unit price")
|
||||
verbose_name=_("Unit price"),
|
||||
)
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user