diff --git a/InvenTree/locale/de/LC_MESSAGES/django.po b/InvenTree/locale/de/LC_MESSAGES/django.po index 35589a06d2..0bf8f61634 100644 --- a/InvenTree/locale/de/LC_MESSAGES/django.po +++ b/InvenTree/locale/de/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-05 21:52+0000\n" +"POT-Creation-Date: 2020-01-05 22:23+0000\n" "PO-Revision-Date: 2019-12-19 17:48+0100\n" "Last-Translator: \n" "Language-Team: \n" @@ -429,24 +429,42 @@ msgstr "Notiz" msgid "Notes" msgstr "Notizen" -#: order/views.py:140 +#: order/views.py:141 msgid "Confirm order cancellation" msgstr "Bestell-Stornierung bestätigen" -#: order/views.py:173 +#: order/views.py:174 msgid "Confirm order placement" msgstr "Bestellungstätigung bestätigen" -#: order/views.py:731 +#: order/views.py:328 +#, fuzzy +#| msgid "Number of items received" +msgid "Items received" +msgstr "Empfangene Objekt-Anzahl" + +#: order/views.py:342 +msgid "No destination set" +msgstr "" + +#: order/views.py:373 +msgid "Error converting quantity to number" +msgstr "" + +#: order/views.py:379 +msgid "Receive quantity less than zero" +msgstr "" + +#: order/views.py:740 msgid "Invalid Purchase Order" msgstr "Ungültige Bestellung" -#: order/views.py:739 +#: order/views.py:748 #, fuzzy msgid "Supplier must match for Part and Order" msgstr "Zulieferer muss zum Teil und zur Bestellung passen" -#: order/views.py:744 +#: order/views.py:753 msgid "Invalid SupplierPart selection" msgstr "Ungültige Wahl des Zulieferer-Teils" diff --git a/InvenTree/locale/en/LC_MESSAGES/django.po b/InvenTree/locale/en/LC_MESSAGES/django.po index 48bc10ef20..5266643986 100644 --- a/InvenTree/locale/en/LC_MESSAGES/django.po +++ b/InvenTree/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-05 21:52+0000\n" +"POT-Creation-Date: 2020-01-05 22:23+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -420,23 +420,39 @@ msgstr "" msgid "Notes" msgstr "" -#: order/views.py:140 +#: order/views.py:141 msgid "Confirm order cancellation" msgstr "" -#: order/views.py:173 +#: order/views.py:174 msgid "Confirm order placement" msgstr "" -#: order/views.py:731 +#: order/views.py:328 +msgid "Items received" +msgstr "" + +#: order/views.py:342 +msgid "No destination set" +msgstr "" + +#: order/views.py:373 +msgid "Error converting quantity to number" +msgstr "" + +#: order/views.py:379 +msgid "Receive quantity less than zero" +msgstr "" + +#: order/views.py:740 msgid "Invalid Purchase Order" msgstr "" -#: order/views.py:739 +#: order/views.py:748 msgid "Supplier must match for Part and Order" msgstr "" -#: order/views.py:744 +#: order/views.py:753 msgid "Invalid SupplierPart selection" msgstr "" diff --git a/InvenTree/locale/es/LC_MESSAGES/django.po b/InvenTree/locale/es/LC_MESSAGES/django.po index 48bc10ef20..5266643986 100644 --- a/InvenTree/locale/es/LC_MESSAGES/django.po +++ b/InvenTree/locale/es/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-01-05 21:52+0000\n" +"POT-Creation-Date: 2020-01-05 22:23+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -420,23 +420,39 @@ msgstr "" msgid "Notes" msgstr "" -#: order/views.py:140 +#: order/views.py:141 msgid "Confirm order cancellation" msgstr "" -#: order/views.py:173 +#: order/views.py:174 msgid "Confirm order placement" msgstr "" -#: order/views.py:731 +#: order/views.py:328 +msgid "Items received" +msgstr "" + +#: order/views.py:342 +msgid "No destination set" +msgstr "" + +#: order/views.py:373 +msgid "Error converting quantity to number" +msgstr "" + +#: order/views.py:379 +msgid "Receive quantity less than zero" +msgstr "" + +#: order/views.py:740 msgid "Invalid Purchase Order" msgstr "" -#: order/views.py:739 +#: order/views.py:748 msgid "Supplier must match for Part and Order" msgstr "" -#: order/views.py:744 +#: order/views.py:753 msgid "Invalid SupplierPart selection" msgstr "" diff --git a/InvenTree/order/views.py b/InvenTree/order/views.py index 8e3f32f907..b4cde63e18 100644 --- a/InvenTree/order/views.py +++ b/InvenTree/order/views.py @@ -12,6 +12,7 @@ from django.views.generic import DetailView, ListView from django.forms import HiddenInput import logging +from decimal import Decimal, InvalidOperation from .models import PurchaseOrder, PurchaseOrderLineItem from .admin import POLineItemResource @@ -324,6 +325,8 @@ class PurchaseOrderReceive(AjaxUpdateView): self.lines = [] self.destination = None + msg = _("Items received") + # Extract the destination for received parts if 'location' in request.POST: pk = request.POST['location'] @@ -332,7 +335,11 @@ class PurchaseOrderReceive(AjaxUpdateView): except (StockLocation.DoesNotExist, ValueError): pass - errors = self.destination is None + errors = False + + if self.destination is None: + errors = True + msg = _("No destination set") # Extract information on all submitted line items for item in request.POST: @@ -359,15 +366,17 @@ class PurchaseOrderReceive(AjaxUpdateView): receive = self.request.POST[item] try: - receive = int(receive) - except ValueError: + receive = Decimal(receive) + except InvalidOperation: # In the case on an invalid input, reset to default receive = line.remaining() + msg = _("Error converting quantity to number") errors = True if receive < 0: receive = 0 errors = True + msg = _("Receive quantity less than zero") line.receive_quantity = receive self.lines.append(line) @@ -378,7 +387,7 @@ class PurchaseOrderReceive(AjaxUpdateView): data = { 'form_valid': errors is False, - 'success': 'Items marked as received', + 'success': msg, } return self.renderJsonResponse(request, data=data, form=self.get_form())