mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Some small tweaks
This commit is contained in:
parent
e5e6480099
commit
ba49b080b0
@ -533,7 +533,7 @@ 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 "{supplier} ({sku})".format(
|
||||||
sku=self.SKU,
|
sku=self.SKU,
|
||||||
supplier=self.supplier.name)
|
supplier=self.supplier.name)
|
||||||
|
|
||||||
|
@ -77,6 +77,14 @@ class StockItem(models.Model):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def clean(self):
|
def clean(self):
|
||||||
|
""" Validate the StockItem object (separate to field validation)
|
||||||
|
|
||||||
|
The following validation checks are performed:
|
||||||
|
|
||||||
|
- The 'part' and 'supplier_part.part' fields cannot point to the same Part object
|
||||||
|
- The 'part' does not belong to itself
|
||||||
|
- Quantity must be 1 if the StockItem has a serial number
|
||||||
|
"""
|
||||||
|
|
||||||
# The 'supplier_part' field must point to the same part!
|
# The 'supplier_part' field must point to the same part!
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user