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