mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
PEP fixes
This commit is contained in:
parent
52c3a63c61
commit
19a11eac1a
@ -516,7 +516,7 @@ class SupplierPart(models.Model):
|
|||||||
""" Calculate the supplier price based on quantity price breaks.
|
""" Calculate the supplier price based on quantity price breaks.
|
||||||
- If no price breaks available, use the single_price field
|
- If no price breaks available, use the single_price field
|
||||||
- Don't forget to add in flat-fee cost (base_cost field)
|
- Don't forget to add in flat-fee cost (base_cost field)
|
||||||
- If MOQ (minimum order quantity) is required, bump quantity
|
- If MOQ (minimum order quantity) is required, bump quantity
|
||||||
- If order multiples are to be observed, then we need to calculate based on that, too
|
- If order multiples are to be observed, then we need to calculate based on that, too
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -552,7 +552,6 @@ class SupplierPart(models.Model):
|
|||||||
|
|
||||||
return cost + self.base_cost
|
return cost + self.base_cost
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "{sku} - {supplier}".format(
|
return "{sku} - {supplier}".format(
|
||||||
sku=self.SKU,
|
sku=self.SKU,
|
||||||
@ -566,7 +565,7 @@ class SupplierPriceBreak(models.Model):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
part = models.ForeignKey(SupplierPart, on_delete=models.CASCADE, related_name='price_breaks')
|
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!
|
# 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(2)])
|
||||||
|
|
||||||
|
@ -115,4 +115,4 @@ class SupplierPriceBreakSerializer(serializers.ModelSerializer):
|
|||||||
'part',
|
'part',
|
||||||
'quantity',
|
'quantity',
|
||||||
'cost'
|
'cost'
|
||||||
]
|
]
|
||||||
|
@ -341,7 +341,6 @@ class SupplierPartCreate(AjaxCreateView):
|
|||||||
form_class = EditSupplierPartForm
|
form_class = EditSupplierPartForm
|
||||||
ajax_template_name = 'modal_form.html'
|
ajax_template_name = 'modal_form.html'
|
||||||
ajax_form_title = 'Create new Supplier Part'
|
ajax_form_title = 'Create new Supplier Part'
|
||||||
#template_name = 'company/partcreate.html'
|
|
||||||
context_object_name = 'part'
|
context_object_name = 'part'
|
||||||
|
|
||||||
def get_initial(self):
|
def get_initial(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user