mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge remote-tracking branch 'inventree/master'
This commit is contained in:
commit
207d2bb4d3
@ -533,7 +533,7 @@ class SupplierPart(models.Model):
|
||||
return cost + self.base_cost
|
||||
|
||||
def __str__(self):
|
||||
return "{sku} - {supplier}".format(
|
||||
return "{supplier} ({sku})".format(
|
||||
sku=self.SKU,
|
||||
supplier=self.supplier.name)
|
||||
|
||||
|
@ -77,6 +77,14 @@ class StockItem(models.Model):
|
||||
)
|
||||
|
||||
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!
|
||||
try:
|
||||
|
@ -1,15 +1,15 @@
|
||||
Django==2.2
|
||||
psycopg2>=2.8.1
|
||||
pillow>=5.0.0
|
||||
djangorestframework>=3.6.2
|
||||
django_filter>=1.0.2
|
||||
coreapi>=2.3.0
|
||||
pygments>=2.2.0
|
||||
tablib>=0.13.0
|
||||
django-crispy-forms>=1.7.2
|
||||
django-import-export>=1.0.0
|
||||
django-cleanup>=2.1.0
|
||||
django-qr-code==1.0.0
|
||||
flake8==3.3.0
|
||||
coverage>=4.5.3
|
||||
python-coveralls==2.9.1
|
||||
Django==2.2 # Django package
|
||||
psycopg2>=2.8.1 # PostgreSQL package
|
||||
pillow>=5.0.0 # Image manipulation
|
||||
djangorestframework>=3.6.2 # DRF framework
|
||||
django_filter>=1.0.2 # Extended filtering options
|
||||
coreapi>=2.3.0 # API documentation
|
||||
pygments>=2.2.0 # Syntax highlighting
|
||||
tablib>=0.13.0 # Import / export data files
|
||||
django-crispy-forms>=1.7.2 # Form helpers
|
||||
django-import-export>=1.0.0 # Data import / export for admin interface
|
||||
django-cleanup>=2.1.0 # Manage deletion of old / unused uploaded files
|
||||
django-qr-code==1.0.0 # Generate QR codes
|
||||
flake8==3.3.0 # PEP checking
|
||||
coverage>=4.5.3 # Unit test coverage
|
||||
python-coveralls==2.9.1 # Coveralls linking (for Travis)
|
Loading…
Reference in New Issue
Block a user