Remove 'minimum' order from SupplierPart

- This can be handled using the 'PriceBreak' set
This commit is contained in:
Oliver Walters 2019-05-21 13:51:43 +10:00
parent 357bfdae3f
commit 6f73c379c2
4 changed files with 17 additions and 11 deletions

View File

@ -57,7 +57,6 @@ class EditSupplierPartForm(HelperForm):
'note',
'base_cost',
'multiple',
'minimum',
'packaging',
'lead_time'
]

View File

@ -0,0 +1,17 @@
# Generated by Django 2.2 on 2019-05-21 03:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('company', '0002_auto_20190520_2204'),
]
operations = [
migrations.RemoveField(
model_name='supplierpart',
name='minimum',
),
]

View File

@ -173,7 +173,6 @@ class SupplierPart(models.Model):
note: Longer form note field
base_cost: Base charge added to order independent of quantity e.g. "Reeling Fee"
multiple: Multiple that the part is provided in
minimum: MOQ (minimum order quantity) required for purchase
lead_time: Supplier lead time
packaging: packaging that the part is supplied in, e.g. "Reel"
"""
@ -217,8 +216,6 @@ class SupplierPart(models.Model):
multiple = models.PositiveIntegerField(default=1, validators=[MinValueValidator(1)], help_text='Order multiple')
minimum = models.PositiveIntegerField(default=1, validators=[MinValueValidator(1)], help_text='Minimum order quantity (MOQ)')
lead_time = models.DurationField(blank=True, null=True)
@property
@ -256,10 +253,6 @@ class SupplierPart(models.Model):
if len(price_breaks) == 0:
return None
# Minimum ordering requirement
if moq and self.minimum > quantity:
quantity = self.minimum
# Order multiples
if multiples:
quantity = int(math.ceil(quantity / self.multiple) * self.multiple)

View File

@ -66,9 +66,6 @@ InvenTree | {{ company.name }} - Parts
{% if part.base_cost > 0 %}
<tr><td>Base Price (Flat Fee)</td><td>{{ part.base_cost }}</td></tr>
{% endif %}
{% if part.minimum > 1 %}
<tr><td>Minimum Order Quantity</td><td>{{ part.minimum }}</td></tr>
{% endif %}
<tr>
<th>Price Breaks</th>
<th>