2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-03 04:00:57 +00:00

Change item quantity field from PositiveInteger to Decimal

- Allow 'partial' quantity e.g. '0.45kg'
- Need to change some maths functions as Decimal type is pernickity
This commit is contained in:
Oliver Walters
2019-11-19 08:49:54 +11:00
parent 81a226c760
commit 400941c10f
4 changed files with 41 additions and 3 deletions

View File

@ -323,7 +323,7 @@ class StockItem(models.Model):
batch = models.CharField(max_length=100, blank=True, null=True,
help_text=_('Batch code for this stock item'))
quantity = models.PositiveIntegerField(validators=[MinValueValidator(0)], default=1)
quantity = models.DecimalField(max_digits=15, decimal_places=5, validators=[MinValueValidator(0)], default=1)
updated = models.DateField(auto_now=True, null=True)