mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
PEP fixes
This commit is contained in:
parent
542b4113a1
commit
90593a187c
@ -10,63 +10,9 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from django import forms
|
||||
|
||||
from InvenTree.forms import HelperForm
|
||||
from InvenTree.fields import RoundingDecimalFormField
|
||||
from InvenTree.fields import DatePickerFormField
|
||||
|
||||
from InvenTree.status_codes import StockStatus
|
||||
|
||||
from .models import Build
|
||||
|
||||
from stock.models import StockLocation, StockItem
|
||||
|
||||
|
||||
class EditBuildForm(HelperForm):
|
||||
""" Form for editing a Build object.
|
||||
"""
|
||||
|
||||
field_prefix = {
|
||||
'reference': 'BO',
|
||||
'link': 'fa-link',
|
||||
'batch': 'fa-layer-group',
|
||||
'serial-numbers': 'fa-hashtag',
|
||||
'location': 'fa-map-marker-alt',
|
||||
'target_date': 'fa-calendar-alt',
|
||||
}
|
||||
|
||||
field_placeholder = {
|
||||
'reference': _('Build Order reference'),
|
||||
'target_date': _('Order target date'),
|
||||
}
|
||||
|
||||
target_date = DatePickerFormField(
|
||||
label=_('Target Date'),
|
||||
help_text=_('Target date for build completion. Build will be overdue after this date.')
|
||||
)
|
||||
|
||||
quantity = RoundingDecimalFormField(
|
||||
max_digits=10, decimal_places=5,
|
||||
label=_('Quantity'),
|
||||
help_text=_('Number of items to build')
|
||||
)
|
||||
|
||||
class Meta:
|
||||
model = Build
|
||||
fields = [
|
||||
'reference',
|
||||
'title',
|
||||
'part',
|
||||
'quantity',
|
||||
'batch',
|
||||
'target_date',
|
||||
'take_from',
|
||||
'destination',
|
||||
'parent',
|
||||
'sales_order',
|
||||
'link',
|
||||
'issued_by',
|
||||
'responsible',
|
||||
]
|
||||
|
||||
|
||||
class BuildOutputCreateForm(HelperForm):
|
||||
"""
|
||||
|
@ -12,16 +12,17 @@ from django.forms import HiddenInput
|
||||
|
||||
from .models import Build
|
||||
from . import forms
|
||||
from stock.models import StockLocation, StockItem
|
||||
from stock.models import StockItem
|
||||
|
||||
from InvenTree.views import AjaxUpdateView, AjaxDeleteView
|
||||
from InvenTree.views import InvenTreeRoleMixin
|
||||
from InvenTree.helpers import str2bool, extract_serial_numbers
|
||||
from InvenTree.status_codes import BuildStatus, StockStatus
|
||||
from InvenTree.status_codes import BuildStatus
|
||||
|
||||
|
||||
class BuildIndex(InvenTreeRoleMixin, ListView):
|
||||
""" View for displaying list of Builds
|
||||
"""
|
||||
View for displaying list of Builds
|
||||
"""
|
||||
model = Build
|
||||
template_name = 'build/index.html'
|
||||
@ -279,7 +280,9 @@ class BuildComplete(AjaxUpdateView):
|
||||
|
||||
|
||||
class BuildDetail(InvenTreeRoleMixin, DetailView):
|
||||
""" Detail view of a single Build object. """
|
||||
"""
|
||||
Detail view of a single Build object.
|
||||
"""
|
||||
|
||||
model = Build
|
||||
template_name = 'build/detail.html'
|
||||
@ -307,7 +310,9 @@ class BuildDetail(InvenTreeRoleMixin, DetailView):
|
||||
|
||||
|
||||
class BuildDelete(AjaxDeleteView):
|
||||
""" View to delete a build """
|
||||
"""
|
||||
View to delete a build
|
||||
"""
|
||||
|
||||
model = Build
|
||||
ajax_template_name = 'build/delete_build.html'
|
||||
|
Loading…
Reference in New Issue
Block a user