mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Bugs!
Thanks, unit testing
This commit is contained in:
parent
b28487760a
commit
bbe714c8f7
@ -61,11 +61,15 @@ class StockDetail(generics.RetrieveUpdateDestroyAPIView):
|
|||||||
|
|
||||||
def get_serializer(self, *args, **kwargs):
|
def get_serializer(self, *args, **kwargs):
|
||||||
|
|
||||||
part_detail = str2bool(self.request.GET.get('part_detail', False))
|
try:
|
||||||
loc_detail = str2bool(self.request.GET.get('location_detail', False))
|
kwargs['part_detail'] = str2bool(self.request.GET.get('part_detail', False))
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
kwargs['part_detail'] = part_detail
|
try:
|
||||||
kwargs['location_detail'] = loc_detail
|
kwargs['location_detail'] = str2bool(self.request.GET.get('location_detail', False))
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
kwargs['context'] = self.get_serializer_context()
|
kwargs['context'] = self.get_serializer_context()
|
||||||
|
|
||||||
|
@ -427,7 +427,7 @@ class StockItem(MPTTModel):
|
|||||||
quantity=self.quantity,
|
quantity=self.quantity,
|
||||||
date=datetime.now().date(),
|
date=datetime.now().date(),
|
||||||
notes=notes,
|
notes=notes,
|
||||||
URL=url,
|
link=url,
|
||||||
system=system
|
system=system
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -934,7 +934,7 @@ class StockItemCreate(AjaxCreateView):
|
|||||||
batch=form_data.get('batch'),
|
batch=form_data.get('batch'),
|
||||||
delete_on_deplete=False,
|
delete_on_deplete=False,
|
||||||
status=form_data.get('status'),
|
status=form_data.get('status'),
|
||||||
URL=form_data.get('URL'),
|
link=form_data.get('link'),
|
||||||
)
|
)
|
||||||
|
|
||||||
item.save(user=request.user)
|
item.save(user=request.user)
|
||||||
|
Loading…
Reference in New Issue
Block a user