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:
Oliver 2022-05-27 15:12:15 +10:00 committed by GitHub
parent 6c7a80c141
commit 09a4fab0d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 20 deletions

View File

@ -173,12 +173,9 @@ class StockStatus(StatusCode):
DESTROYED = 60 # Item is destroyed
REJECTED = 65 # Item is rejected
LOST = 70 # Item has been lost
QUARANTINED = 75 # Item has been quarantined and is unavailable
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 = {
OK: _("OK"),
ATTENTION: _("Attention needed"),
@ -186,6 +183,7 @@ class StockStatus(StatusCode):
DESTROYED: _("Destroyed"),
LOST: _("Lost"),
REJECTED: _("Rejected"),
QUARANTINED: _("Quarantined"),
RETURNED: _("Returned"),
}
@ -196,6 +194,7 @@ class StockStatus(StatusCode):
DESTROYED: 'danger',
LOST: 'dark',
REJECTED: 'danger',
QUARANTINED: 'info'
}
# The following codes correspond to parts that are 'available' or 'in stock'
@ -206,22 +205,6 @@ class StockStatus(StatusCode):
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):

View 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)]),
),
]