mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Update minimum_stock field (#5609)
- Allow non-integer values - Change column type
This commit is contained in:
parent
7e6db65cac
commit
b69342a3d2
19
InvenTree/part/migrations/0114_alter_part_minimum_stock.py
Normal file
19
InvenTree/part/migrations/0114_alter_part_minimum_stock.py
Normal file
@ -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'),
|
||||
),
|
||||
]
|
@ -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')
|
||||
|
@ -203,7 +203,7 @@
|
||||
<tr>
|
||||
<td><span class='fas fa-flag'></span></td>
|
||||
<td>{% trans "Minimum Stock" %}</td>
|
||||
<td>{{ part.minimum_stock }} {% include "part/part_units.html" %}</td>
|
||||
<td>{% decimal part.minimum_stock %} {% include "part/part_units.html" %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if on_order > 0 %}
|
||||
@ -291,7 +291,7 @@
|
||||
<tr>
|
||||
<td><span class='fas fa-flag'></span></td>
|
||||
<td>{% trans "Minimum stock level" %}</td>
|
||||
<td>{{ part.minimum_stock }}</td>
|
||||
<td>{% decimal part.minimum_stock %}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.keywords %}
|
||||
|
Loading…
Reference in New Issue
Block a user