mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP style fixes
This commit is contained in:
parent
adbcd68fe8
commit
1cefdfc2e4
@ -42,7 +42,7 @@ class InvenTreeMetadata(SimpleMetadata):
|
||||
"""
|
||||
Custom context information to pass through to the OPTIONS endpoint,
|
||||
if the "context=True" is supplied to the OPTIONS requst
|
||||
|
||||
|
||||
Serializer class can supply context data by defining a get_context_data() method (no arguments)
|
||||
"""
|
||||
|
||||
|
@ -486,7 +486,7 @@ class Build(MPTTModel, ReferenceIndexingMixin):
|
||||
|
||||
for output in self.complete_outputs:
|
||||
quantity += output.quantity
|
||||
|
||||
|
||||
return quantity
|
||||
|
||||
@property
|
||||
|
@ -9,11 +9,9 @@ from django.utils.translation import gettext_lazy as _
|
||||
from django.views.generic import DetailView, ListView
|
||||
|
||||
from .models import Build
|
||||
from . import forms
|
||||
|
||||
from InvenTree.views import AjaxUpdateView, AjaxDeleteView
|
||||
from InvenTree.views import AjaxDeleteView
|
||||
from InvenTree.views import InvenTreeRoleMixin
|
||||
from InvenTree.helpers import str2bool
|
||||
from InvenTree.status_codes import BuildStatus
|
||||
|
||||
|
||||
|
@ -337,7 +337,6 @@ class PurchaseOrderIssue(PurchaseOrderContextMixin, generics.CreateAPIView):
|
||||
serializer_class = serializers.PurchaseOrderIssueSerializer
|
||||
|
||||
|
||||
|
||||
class PurchaseOrderReceive(PurchaseOrderContextMixin, generics.CreateAPIView):
|
||||
"""
|
||||
API endpoint to receive stock items against a purchase order.
|
||||
|
@ -204,7 +204,7 @@ class PurchaseOrderCancelSerializer(serializers.Serializer):
|
||||
|
||||
if not order.can_cancel():
|
||||
raise ValidationError(_("Order cannot be cancelled"))
|
||||
|
||||
|
||||
order.cancel_order()
|
||||
|
||||
|
||||
@ -238,7 +238,6 @@ class PurchaseOrderIssueSerializer(serializers.Serializer):
|
||||
|
||||
class Meta:
|
||||
fields = []
|
||||
|
||||
|
||||
def save(self):
|
||||
|
||||
|
@ -30,9 +30,8 @@ from common.files import FileManager
|
||||
from . import forms as order_forms
|
||||
from part.views import PartPricing
|
||||
|
||||
from InvenTree.views import AjaxView, AjaxUpdateView
|
||||
from InvenTree.helpers import DownloadFile, str2bool
|
||||
from InvenTree.views import InvenTreeRoleMixin
|
||||
from InvenTree.helpers import DownloadFile
|
||||
from InvenTree.views import InvenTreeRoleMixin, AjaxView
|
||||
|
||||
|
||||
logger = logging.getLogger("inventree")
|
||||
|
@ -107,6 +107,7 @@ class StockItemContextMixin:
|
||||
|
||||
return context
|
||||
|
||||
|
||||
class StockItemSerialize(StockItemContextMixin, generics.CreateAPIView):
|
||||
"""
|
||||
API endpoint for serializing a stock item
|
||||
|
@ -5,17 +5,9 @@ Django Forms for interacting with Stock app
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django import forms
|
||||
from django.forms.utils import ErrorDict
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
|
||||
from mptt.fields import TreeNodeChoiceField
|
||||
|
||||
from InvenTree.forms import HelperForm
|
||||
from InvenTree.fields import RoundingDecimalFormField
|
||||
from InvenTree.fields import DatePickerFormField
|
||||
|
||||
from .models import StockLocation, StockItem, StockItemTracking
|
||||
from .models import StockItem, StockItemTracking
|
||||
|
||||
|
||||
class ReturnStockItemForm(HelperForm):
|
||||
|
@ -5,6 +5,7 @@ Django views for interacting with Stock app
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from django.views.generic import DetailView, ListView
|
||||
from django.urls import reverse
|
||||
|
Loading…
Reference in New Issue
Block a user