mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Update validator for supplier price break
This commit is contained in:
parent
92632b2ef7
commit
a3cd54875c
19
InvenTree/part/migrations/0029_auto_20190518_1632.py
Normal file
19
InvenTree/part/migrations/0029_auto_20190518_1632.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2 on 2019-05-18 06:32
|
||||
|
||||
import django.core.validators
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('part', '0028_auto_20190518_1627'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='supplierpricebreak',
|
||||
name='quantity',
|
||||
field=models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1)]),
|
||||
),
|
||||
]
|
@ -941,8 +941,7 @@ class SupplierPriceBreak(models.Model):
|
||||
|
||||
part = models.ForeignKey(SupplierPart, on_delete=models.CASCADE, related_name='price_breaks')
|
||||
|
||||
# At least 2 units are required for a 'price break' - Otherwise, just use single-price!
|
||||
quantity = models.PositiveIntegerField(validators=[MinValueValidator(2)])
|
||||
quantity = models.PositiveIntegerField(validators=[MinValueValidator(1)])
|
||||
|
||||
cost = models.DecimalField(max_digits=10, decimal_places=3, validators=[MinValueValidator(0)])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user