diff --git a/InvenTree/part/migrations/0114_alter_part_minimum_stock.py b/InvenTree/part/migrations/0114_alter_part_minimum_stock.py new file mode 100644 index 0000000000..2845504b0a --- /dev/null +++ b/InvenTree/part/migrations/0114_alter_part_minimum_stock.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.21 on 2023-09-24 13:27 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('part', '0113_auto_20230531_1205'), + ] + + operations = [ + migrations.AlterField( + model_name='part', + name='minimum_stock', + field=models.DecimalField(decimal_places=6, default=0, help_text='Minimum allowed stock level', max_digits=19, validators=[django.core.validators.MinValueValidator(0)], verbose_name='Minimum Stock'), + ), + ] diff --git a/InvenTree/part/models.py b/InvenTree/part/models.py index 7caa9dfff0..797d96f2e4 100644 --- a/InvenTree/part/models.py +++ b/InvenTree/part/models.py @@ -979,7 +979,8 @@ class Part(InvenTreeBarcodeMixin, InvenTreeNotesMixin, MetadataMixin, MPTTModel) help_text=_('Expiry time (in days) for stock items of this part'), ) - minimum_stock = models.PositiveIntegerField( + minimum_stock = models.DecimalField( + max_digits=19, decimal_places=6, default=0, validators=[MinValueValidator(0)], verbose_name=_('Minimum Stock'), help_text=_('Minimum allowed stock level') diff --git a/InvenTree/part/templates/part/part_base.html b/InvenTree/part/templates/part/part_base.html index bf2142948f..df2e138338 100644 --- a/InvenTree/part/templates/part/part_base.html +++ b/InvenTree/part/templates/part/part_base.html @@ -203,7 +203,7 @@ {% trans "Minimum Stock" %} - {{ part.minimum_stock }} {% include "part/part_units.html" %} + {% decimal part.minimum_stock %} {% include "part/part_units.html" %} {% endif %} {% if on_order > 0 %} @@ -291,7 +291,7 @@ {% trans "Minimum stock level" %} - {{ part.minimum_stock }} + {% decimal part.minimum_stock %} {% endif %} {% if part.keywords %}