2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 11:10:54 +00:00

[FR] Confirm to W293

Fixes #2335
This commit is contained in:
Matthias
2021-11-23 00:28:23 +01:00
parent b1930404bd
commit d884e62be1
49 changed files with 103 additions and 103 deletions

View File

@ -91,7 +91,7 @@ class StockDetail(generics.RetrieveUpdateDestroyAPIView):
Instead of "deleting" the StockItem
(which may take a long time)
we instead schedule it for deletion at a later date.
The background worker will delete these in the future
"""
@ -134,7 +134,7 @@ class StockAdjustView(generics.CreateAPIView):
queryset = StockItem.objects.none()
def get_serializer_context(self):
context = super().get_serializer_context()
context['request'] = self.request
@ -348,7 +348,7 @@ class StockFilter(rest_filters.FilterSet):
queryset = queryset.exclude(customer=None)
else:
queryset = queryset.filter(customer=None)
return queryset
depleted = rest_filters.BooleanFilter(label='Depleted', method='filter_depleted')
@ -437,7 +437,7 @@ class StockList(generics.ListCreateAPIView):
})
with transaction.atomic():
# Create an initial stock item
item = serializer.save()

View File

@ -83,7 +83,7 @@ class ConvertStockItemForm(HelperForm):
class CreateStockItemForm(HelperForm):
"""
Form for creating a new StockItem
TODO: Migrate this form to the modern API forms interface
"""
@ -143,7 +143,7 @@ class CreateStockItemForm(HelperForm):
class SerializeStockForm(HelperForm):
"""
Form for serializing a StockItem.
TODO: Migrate this form to the modern API forms interface
"""

View File

@ -272,7 +272,7 @@ class StockItem(MPTTModel):
add_note = kwargs.pop('add_note', True)
notes = kwargs.pop('notes', '')
if self.pk:
# StockItem has already been saved

View File

@ -56,7 +56,7 @@ class StockItemSerializerBrief(InvenTree.serializers.InvenTreeModelSerializer):
location_name = serializers.CharField(source='location', read_only=True)
part_name = serializers.CharField(source='part.full_name', read_only=True)
quantity = InvenTreeDecimalField()
class Meta:
@ -615,7 +615,7 @@ class StockCountSerializer(StockAdjustmentSerializer):
stock_item = item['pk']
quantity = item['quantity']
stock_item.stocktake(
quantity,
request.user,
@ -654,7 +654,7 @@ class StockRemoveSerializer(StockAdjustmentSerializer):
"""
def save(self):
request = self.context['request']
data = self.validated_data
@ -707,7 +707,7 @@ class StockTransferSerializer(StockAdjustmentSerializer):
request = self.context['request']
data = self.validated_data
items = data['items']
notes = data.get('notes', '')
location = data['location']

View File

@ -368,7 +368,7 @@ class StockItemTest(StockAPITestCase):
)
self.assertIn('Quantity is required', str(response.data))
# POST with quantity and part and location
response = self.post(
self.list_url,

View File

@ -11,7 +11,7 @@ location_urls = [
url(r'^(?P<pk>\d+)/', include([
url(r'^delete/?', views.StockLocationDelete.as_view(), name='stock-location-delete'),
url(r'^qr_code/?', views.StockLocationQRCode.as_view(), name='stock-location-qr'),
# Anything else
url('^.*$', views.StockLocationDetail.as_view(), name='stock-location-detail'),
])),

View File

@ -543,7 +543,7 @@ class StockItemInstall(AjaxUpdateView):
- Items must be in BOM of stock item
- Items must be serialized
"""
# Filter items in stock
items = StockItem.objects.filter(StockItem.IN_STOCK_FILTER)
@ -900,7 +900,7 @@ class StockItemEdit(AjaxUpdateView):
item.save(user=self.request.user)
return item
class StockItemConvert(AjaxUpdateView):
"""