2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 19:15:41 +00:00

Fix code to move multiple parts via AJAX / JSON

This commit is contained in:
Oliver Walters
2019-04-25 23:16:54 +10:00
parent 757cd539b2
commit 990808ec03
2 changed files with 30 additions and 29 deletions

View File

@ -166,12 +166,15 @@ class StockMove(APIView):
if len(errors) > 0:
raise ValidationError(errors)
n = 0
for part in parts:
part.move(location, data.get('notes'), request.user)
if part.move(location, data.get('notes'), request.user):
n += 1
return Response({'success': 'Moved {n} parts to {loc}'.format(
n=len(parts),
loc=location.name
n=n,
loc=str(location)
)})