2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 03:25:42 +00:00

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

@ -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)