mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP fixes
This commit is contained in:
parent
c82d5482aa
commit
e199ed2281
@ -21,7 +21,7 @@ class OrderStatus(StatusCode):
|
||||
COMPLETE = 30 # Order has been completed
|
||||
CANCELLED = 40 # Order was cancelled
|
||||
LOST = 50 # Order was lost
|
||||
RETURNED = 60 # Order was returned
|
||||
RETURNED = 60 # Order was returned
|
||||
|
||||
options = {
|
||||
PENDING: _("Pending"),
|
||||
@ -35,7 +35,7 @@ class OrderStatus(StatusCode):
|
||||
|
||||
class StockStatus(StatusCode):
|
||||
|
||||
OK = 10 # Item is OK
|
||||
OK = 10 # Item is OK
|
||||
ATTENTION = 50 # Item requires attention
|
||||
DAMAGED = 55 # Item is damaged
|
||||
DESTROYED = 60 # Item is destroyed
|
||||
|
@ -71,7 +71,6 @@ class Build(models.Model):
|
||||
help_text='Number of parts to build'
|
||||
)
|
||||
|
||||
|
||||
status = models.PositiveIntegerField(default=BuildStatus.PENDING,
|
||||
choices=BuildStatus.items(),
|
||||
validators=[MinValueValidator(0)],
|
||||
|
@ -150,7 +150,6 @@ class Company(models.Model):
|
||||
])
|
||||
|
||||
|
||||
|
||||
class Contact(models.Model):
|
||||
""" A Contact represents a person who works at a particular company.
|
||||
A Company may have zero or more associated Contact objects.
|
||||
|
@ -2,7 +2,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.contrib import admin
|
||||
from import_export.admin import ImportExportModelAdmin
|
||||
|
||||
from .models import PurchaseOrder, PurchaseOrderLineItem
|
||||
|
||||
|
@ -1,12 +1,10 @@
|
||||
from django.db import models, transaction
|
||||
from django.db import models
|
||||
from django.core.validators import MinValueValidator
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from django.utils.translation import ugettext as _
|
||||
|
||||
from part.models import Part
|
||||
from company.models import Company
|
||||
from stock.models import StockItem
|
||||
|
||||
from InvenTree.status_codes import OrderStatus
|
||||
|
||||
@ -75,16 +73,18 @@ class PurchaseOrder(Order):
|
||||
|
||||
ORDER_PREFIX = "PO"
|
||||
|
||||
supplier = models.ForeignKey(Company, on_delete=models.CASCADE,
|
||||
limit_choices_to={
|
||||
'is_supplier': True,
|
||||
},
|
||||
related_name='purchase_orders',
|
||||
help_text=_('Company')
|
||||
)
|
||||
supplier = models.ForeignKey(
|
||||
Company, on_delete=models.CASCADE,
|
||||
limit_choices_to={
|
||||
'is_supplier': True,
|
||||
},
|
||||
related_name='purchase_orders',
|
||||
help_text=_('Company')
|
||||
)
|
||||
|
||||
|
||||
class OrderLineItem(models.Model):
|
||||
""" Abstract model for an order line item
|
||||
""" Abstract model for an order line item
|
||||
|
||||
Attributes:
|
||||
quantity: Number of items
|
||||
@ -101,7 +101,7 @@ class OrderLineItem(models.Model):
|
||||
|
||||
|
||||
class PurchaseOrderLineItem(OrderLineItem):
|
||||
""" Model for a purchase order line item.
|
||||
""" Model for a purchase order line item.
|
||||
|
||||
Attributes:
|
||||
order: Reference to a PurchaseOrder object
|
||||
|
@ -1,3 +1 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
# TODO - Implement tests for the order app
|
||||
|
Loading…
Reference in New Issue
Block a user