mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Adds 'quarantine' code for StockItemStatus (#3084)
* Adds 'quarantine' code for StockItemStatus - Marks item as "unavailable" - Removes unused code from StockItemStatus class * Add migration file
This commit is contained in:
parent
6c7a80c141
commit
09a4fab0d6
@ -173,12 +173,9 @@ class StockStatus(StatusCode):
|
|||||||
DESTROYED = 60 # Item is destroyed
|
DESTROYED = 60 # Item is destroyed
|
||||||
REJECTED = 65 # Item is rejected
|
REJECTED = 65 # Item is rejected
|
||||||
LOST = 70 # Item has been lost
|
LOST = 70 # Item has been lost
|
||||||
|
QUARANTINED = 75 # Item has been quarantined and is unavailable
|
||||||
RETURNED = 85 # Item has been returned from a customer
|
RETURNED = 85 # Item has been returned from a customer
|
||||||
|
|
||||||
# Any stock code above 100 means that the stock item is not "in stock"
|
|
||||||
# This can be used as a quick check for filtering
|
|
||||||
NOT_IN_STOCK = 100
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
OK: _("OK"),
|
OK: _("OK"),
|
||||||
ATTENTION: _("Attention needed"),
|
ATTENTION: _("Attention needed"),
|
||||||
@ -186,6 +183,7 @@ class StockStatus(StatusCode):
|
|||||||
DESTROYED: _("Destroyed"),
|
DESTROYED: _("Destroyed"),
|
||||||
LOST: _("Lost"),
|
LOST: _("Lost"),
|
||||||
REJECTED: _("Rejected"),
|
REJECTED: _("Rejected"),
|
||||||
|
QUARANTINED: _("Quarantined"),
|
||||||
RETURNED: _("Returned"),
|
RETURNED: _("Returned"),
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,6 +194,7 @@ class StockStatus(StatusCode):
|
|||||||
DESTROYED: 'danger',
|
DESTROYED: 'danger',
|
||||||
LOST: 'dark',
|
LOST: 'dark',
|
||||||
REJECTED: 'danger',
|
REJECTED: 'danger',
|
||||||
|
QUARANTINED: 'info'
|
||||||
}
|
}
|
||||||
|
|
||||||
# The following codes correspond to parts that are 'available' or 'in stock'
|
# The following codes correspond to parts that are 'available' or 'in stock'
|
||||||
@ -206,22 +205,6 @@ class StockStatus(StatusCode):
|
|||||||
RETURNED,
|
RETURNED,
|
||||||
]
|
]
|
||||||
|
|
||||||
# The following codes correspond to parts that are 'unavailable'
|
|
||||||
UNAVAILABLE_CODES = [
|
|
||||||
DESTROYED,
|
|
||||||
LOST,
|
|
||||||
REJECTED,
|
|
||||||
]
|
|
||||||
|
|
||||||
# The following codes are available for receiving goods
|
|
||||||
RECEIVING_CODES = [
|
|
||||||
OK,
|
|
||||||
ATTENTION,
|
|
||||||
DAMAGED,
|
|
||||||
DESTROYED,
|
|
||||||
REJECTED
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
class StockHistoryCode(StatusCode):
|
class StockHistoryCode(StatusCode):
|
||||||
|
|
||||||
|
19
InvenTree/stock/migrations/0076_alter_stockitem_status.py
Normal file
19
InvenTree/stock/migrations/0076_alter_stockitem_status.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 3.2.13 on 2022-05-27 04:40
|
||||||
|
|
||||||
|
import django.core.validators
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('stock', '0075_auto_20220515_1440'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='stockitem',
|
||||||
|
name='status',
|
||||||
|
field=models.PositiveIntegerField(choices=[(10, 'OK'), (50, 'Attention needed'), (55, 'Damaged'), (60, 'Destroyed'), (70, 'Lost'), (65, 'Rejected'), (75, 'Quarantined'), (85, 'Returned')], default=10, validators=[django.core.validators.MinValueValidator(0)]),
|
||||||
|
),
|
||||||
|
]
|
Loading…
Reference in New Issue
Block a user