Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2020-01-06 10:11:18 +11:00
commit 07de23f120
6 changed files with 123 additions and 65 deletions

View File

@ -7,41 +7,41 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-12-09 11:16+0000\n" "POT-Creation-Date: 2020-01-05 22:23+0000\n"
"PO-Revision-Date: 2019-12-19 17:48+0100\n" "PO-Revision-Date: 2019-12-19 17:48+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: de\n" "Language: de\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Last-Translator: \n"
"Language-Team: \n"
"X-Generator: Poedit 2.2.4\n" "X-Generator: Poedit 2.2.4\n"
#: InvenTree/helpers.py:175 order/models.py:159 order/models.py:210 #: InvenTree/helpers.py:186 order/models.py:159 order/models.py:210
msgid "Invalid quantity provided" msgid "Invalid quantity provided"
msgstr "Keine gültige Menge" msgstr "Keine gültige Menge"
#: InvenTree/helpers.py:178 #: InvenTree/helpers.py:189
msgid "Empty serial number string" msgid "Empty serial number string"
msgstr "Keine Seriennummer angegeben" msgstr "Keine Seriennummer angegeben"
#: InvenTree/helpers.py:199 InvenTree/helpers.py:216 #: InvenTree/helpers.py:210 InvenTree/helpers.py:227
#, python-brace-format #, python-brace-format
msgid "Duplicate serial: {n}" msgid "Duplicate serial: {n}"
msgstr "Doppelte Seriennummer: {n}" msgstr "Doppelte Seriennummer: {n}"
#: InvenTree/helpers.py:203 InvenTree/helpers.py:206 InvenTree/helpers.py:209 #: InvenTree/helpers.py:214 InvenTree/helpers.py:217 InvenTree/helpers.py:220
#: InvenTree/helpers.py:220 #: InvenTree/helpers.py:231
#, python-brace-format #, python-brace-format
msgid "Invalid group: {g}" msgid "Invalid group: {g}"
msgstr "Ungültige Gruppe: {g}" msgstr "Ungültige Gruppe: {g}"
#: InvenTree/helpers.py:226 #: InvenTree/helpers.py:237
msgid "No serial numbers found" msgid "No serial numbers found"
msgstr "Keine Seriennummern gefunden" msgstr "Keine Seriennummern gefunden"
#: InvenTree/helpers.py:230 #: InvenTree/helpers.py:241
#, python-brace-format #, python-brace-format
msgid "Number of unique serial number ({s}) must match quantity ({q})" msgid "Number of unique serial number ({s}) must match quantity ({q})"
msgstr "" msgstr ""
@ -188,8 +188,7 @@ msgstr "Ausgewähltes Lagerobjekt nicht in BOM für Teil '{p}' gefunden"
#, python-brace-format #, python-brace-format
msgid "Allocated quantity ({n}) must not exceed available quantity ({q})" msgid "Allocated quantity ({n}) must not exceed available quantity ({q})"
msgstr "" msgstr ""
"zugewiesene Anzahl ({n}) darf nicht die verfügbare ({q}) Anzahl " "zugewiesene Anzahl ({n}) darf nicht die verfügbare ({q}) Anzahl überschreiten"
"überschreiten"
#: build/models.py:401 #: build/models.py:401
msgid "Build to allocate parts" msgid "Build to allocate parts"
@ -263,8 +262,8 @@ msgstr "Die folgende Seriennummer existiert bereits: ({sn})"
#: common/models.py:65 #: common/models.py:65
msgid "Settings key (must be unique - case insensitive" msgid "Settings key (must be unique - case insensitive"
msgstr "" msgstr ""
"Einstellungs-Schlüssel (muss einzigartig sein, Groß-/ Kleinschreibung " "Einstellungs-Schlüssel (muss einzigartig sein, Groß-/ Kleinschreibung wird "
"wird nicht beachtet)" "nicht beachtet)"
#: common/models.py:67 #: common/models.py:67
msgid "Settings value" msgid "Settings value"
@ -417,7 +416,7 @@ msgstr "Referenz"
#: order/templates/order/purchase_order_detail.html:111 #: order/templates/order/purchase_order_detail.html:111
#: stock/templates/stock/item.html:89 #: stock/templates/stock/item.html:89
#: stock/templates/stock/stock_adjust.html:20 #: stock/templates/stock/stock_adjust.html:18
msgid "Quantity" msgid "Quantity"
msgstr "Anzahl" msgstr "Anzahl"
@ -430,24 +429,42 @@ msgstr "Notiz"
msgid "Notes" msgid "Notes"
msgstr "Notizen" msgstr "Notizen"
#: order/views.py:140 #: order/views.py:141
msgid "Confirm order cancellation" msgid "Confirm order cancellation"
msgstr "Bestell-Stornierung bestätigen" msgstr "Bestell-Stornierung bestätigen"
#: order/views.py:173 #: order/views.py:174
msgid "Confirm order placement" msgid "Confirm order placement"
msgstr "Bestellungstätigung bestätigen" 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" msgid "Invalid Purchase Order"
msgstr "Ungültige Bestellung" msgstr "Ungültige Bestellung"
#: order/views.py:739 #: order/views.py:748
#, fuzzy #, fuzzy
msgid "Supplier must match for Part and Order" msgid "Supplier must match for Part and Order"
msgstr "Zulieferer muss zum Teil und zur Bestellung passen" msgstr "Zulieferer muss zum Teil und zur Bestellung passen"
#: order/views.py:744 #: order/views.py:753
msgid "Invalid SupplierPart selection" msgid "Invalid SupplierPart selection"
msgstr "Ungültige Wahl des Zulieferer-Teils" msgstr "Ungültige Wahl des Zulieferer-Teils"
@ -479,8 +496,8 @@ msgstr "Teilekategorie wählen"
#: part/forms.py:81 #: part/forms.py:81
msgid "Perform 'deep copy' which will duplicate all BOM data for this part" msgid "Perform 'deep copy' which will duplicate all BOM data for this part"
msgstr "" msgstr ""
"Tiefe Kopie ausführen. Dies wird alle Daten der Stückliste für dieses " "Tiefe Kopie ausführen. Dies wird alle Daten der Stückliste für dieses Teil "
"Teil duplizieren" "duplizieren"
#: part/forms.py:86 #: part/forms.py:86
msgid "Confirm part creation" msgid "Confirm part creation"
@ -1073,8 +1090,8 @@ msgid ""
"This stock item is serialized - it has a unique serial number and the " "This stock item is serialized - it has a unique serial number and the "
"quantity cannot be adjusted." "quantity cannot be adjusted."
msgstr "" msgstr ""
"Dieses Lagerobjekt ist serialisiert. Es hat eine eindeutige Seriennummer " "Dieses Lagerobjekt ist serialisiert. Es hat eine eindeutige Seriennummer und "
"und die Anzahl kann nicht angepasst werden." "die Anzahl kann nicht angepasst werden."
#: stock/templates/stock/item.html:56 #: stock/templates/stock/item.html:56
msgid "" msgid ""
@ -1088,7 +1105,7 @@ msgid "Belongs To"
msgstr "Gehört zu" msgstr "Gehört zu"
#: stock/templates/stock/item.html:78 #: stock/templates/stock/item.html:78
#: stock/templates/stock/stock_adjust.html:16 #: stock/templates/stock/stock_adjust.html:17
msgid "Location" msgid "Location"
msgstr "Standort" msgstr "Standort"
@ -1153,7 +1170,7 @@ msgstr "Objekt-Details"
msgid "Stock Locations" msgid "Stock Locations"
msgstr "Lagerobjekt-Standorte" msgstr "Lagerobjekt-Standorte"
#: stock/templates/stock/stock_adjust.html:15 #: stock/templates/stock/stock_adjust.html:16
msgid "Stock Item" msgid "Stock Item"
msgstr "Lagerobjekt" msgstr "Lagerobjekt"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-12-09 11:16+0000\n" "POT-Creation-Date: 2020-01-05 22:23+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,30 +18,30 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: InvenTree/helpers.py:175 order/models.py:159 order/models.py:210 #: InvenTree/helpers.py:186 order/models.py:159 order/models.py:210
msgid "Invalid quantity provided" msgid "Invalid quantity provided"
msgstr "" msgstr ""
#: InvenTree/helpers.py:178 #: InvenTree/helpers.py:189
msgid "Empty serial number string" msgid "Empty serial number string"
msgstr "" msgstr ""
#: InvenTree/helpers.py:199 InvenTree/helpers.py:216 #: InvenTree/helpers.py:210 InvenTree/helpers.py:227
#, python-brace-format #, python-brace-format
msgid "Duplicate serial: {n}" msgid "Duplicate serial: {n}"
msgstr "" msgstr ""
#: InvenTree/helpers.py:203 InvenTree/helpers.py:206 InvenTree/helpers.py:209 #: InvenTree/helpers.py:214 InvenTree/helpers.py:217 InvenTree/helpers.py:220
#: InvenTree/helpers.py:220 #: InvenTree/helpers.py:231
#, python-brace-format #, python-brace-format
msgid "Invalid group: {g}" msgid "Invalid group: {g}"
msgstr "" msgstr ""
#: InvenTree/helpers.py:226 #: InvenTree/helpers.py:237
msgid "No serial numbers found" msgid "No serial numbers found"
msgstr "" msgstr ""
#: InvenTree/helpers.py:230 #: InvenTree/helpers.py:241
#, python-brace-format #, python-brace-format
msgid "Number of unique serial number ({s}) must match quantity ({q})" msgid "Number of unique serial number ({s}) must match quantity ({q})"
msgstr "" msgstr ""
@ -407,7 +407,7 @@ msgstr ""
#: order/templates/order/purchase_order_detail.html:111 #: order/templates/order/purchase_order_detail.html:111
#: stock/templates/stock/item.html:89 #: stock/templates/stock/item.html:89
#: stock/templates/stock/stock_adjust.html:20 #: stock/templates/stock/stock_adjust.html:18
msgid "Quantity" msgid "Quantity"
msgstr "" msgstr ""
@ -420,23 +420,39 @@ msgstr ""
msgid "Notes" msgid "Notes"
msgstr "" msgstr ""
#: order/views.py:140 #: order/views.py:141
msgid "Confirm order cancellation" msgid "Confirm order cancellation"
msgstr "" msgstr ""
#: order/views.py:173 #: order/views.py:174
msgid "Confirm order placement" msgid "Confirm order placement"
msgstr "" 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" msgid "Invalid Purchase Order"
msgstr "" msgstr ""
#: order/views.py:739 #: order/views.py:748
msgid "Supplier must match for Part and Order" msgid "Supplier must match for Part and Order"
msgstr "" msgstr ""
#: order/views.py:744 #: order/views.py:753
msgid "Invalid SupplierPart selection" msgid "Invalid SupplierPart selection"
msgstr "" msgstr ""
@ -1065,7 +1081,7 @@ msgid "Belongs To"
msgstr "" msgstr ""
#: stock/templates/stock/item.html:78 #: stock/templates/stock/item.html:78
#: stock/templates/stock/stock_adjust.html:16 #: stock/templates/stock/stock_adjust.html:17
msgid "Location" msgid "Location"
msgstr "" msgstr ""
@ -1130,7 +1146,7 @@ msgstr ""
msgid "Stock Locations" msgid "Stock Locations"
msgstr "" msgstr ""
#: stock/templates/stock/stock_adjust.html:15 #: stock/templates/stock/stock_adjust.html:16
msgid "Stock Item" msgid "Stock Item"
msgstr "" msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-12-09 11:16+0000\n" "POT-Creation-Date: 2020-01-05 22:23+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,30 +18,30 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: InvenTree/helpers.py:175 order/models.py:159 order/models.py:210 #: InvenTree/helpers.py:186 order/models.py:159 order/models.py:210
msgid "Invalid quantity provided" msgid "Invalid quantity provided"
msgstr "" msgstr ""
#: InvenTree/helpers.py:178 #: InvenTree/helpers.py:189
msgid "Empty serial number string" msgid "Empty serial number string"
msgstr "" msgstr ""
#: InvenTree/helpers.py:199 InvenTree/helpers.py:216 #: InvenTree/helpers.py:210 InvenTree/helpers.py:227
#, python-brace-format #, python-brace-format
msgid "Duplicate serial: {n}" msgid "Duplicate serial: {n}"
msgstr "" msgstr ""
#: InvenTree/helpers.py:203 InvenTree/helpers.py:206 InvenTree/helpers.py:209 #: InvenTree/helpers.py:214 InvenTree/helpers.py:217 InvenTree/helpers.py:220
#: InvenTree/helpers.py:220 #: InvenTree/helpers.py:231
#, python-brace-format #, python-brace-format
msgid "Invalid group: {g}" msgid "Invalid group: {g}"
msgstr "" msgstr ""
#: InvenTree/helpers.py:226 #: InvenTree/helpers.py:237
msgid "No serial numbers found" msgid "No serial numbers found"
msgstr "" msgstr ""
#: InvenTree/helpers.py:230 #: InvenTree/helpers.py:241
#, python-brace-format #, python-brace-format
msgid "Number of unique serial number ({s}) must match quantity ({q})" msgid "Number of unique serial number ({s}) must match quantity ({q})"
msgstr "" msgstr ""
@ -407,7 +407,7 @@ msgstr ""
#: order/templates/order/purchase_order_detail.html:111 #: order/templates/order/purchase_order_detail.html:111
#: stock/templates/stock/item.html:89 #: stock/templates/stock/item.html:89
#: stock/templates/stock/stock_adjust.html:20 #: stock/templates/stock/stock_adjust.html:18
msgid "Quantity" msgid "Quantity"
msgstr "" msgstr ""
@ -420,23 +420,39 @@ msgstr ""
msgid "Notes" msgid "Notes"
msgstr "" msgstr ""
#: order/views.py:140 #: order/views.py:141
msgid "Confirm order cancellation" msgid "Confirm order cancellation"
msgstr "" msgstr ""
#: order/views.py:173 #: order/views.py:174
msgid "Confirm order placement" msgid "Confirm order placement"
msgstr "" 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" msgid "Invalid Purchase Order"
msgstr "" msgstr ""
#: order/views.py:739 #: order/views.py:748
msgid "Supplier must match for Part and Order" msgid "Supplier must match for Part and Order"
msgstr "" msgstr ""
#: order/views.py:744 #: order/views.py:753
msgid "Invalid SupplierPart selection" msgid "Invalid SupplierPart selection"
msgstr "" msgstr ""
@ -1065,7 +1081,7 @@ msgid "Belongs To"
msgstr "" msgstr ""
#: stock/templates/stock/item.html:78 #: stock/templates/stock/item.html:78
#: stock/templates/stock/stock_adjust.html:16 #: stock/templates/stock/stock_adjust.html:17
msgid "Location" msgid "Location"
msgstr "" msgstr ""
@ -1130,7 +1146,7 @@ msgstr ""
msgid "Stock Locations" msgid "Stock Locations"
msgstr "" msgstr ""
#: stock/templates/stock/stock_adjust.html:15 #: stock/templates/stock/stock_adjust.html:16
msgid "Stock Item" msgid "Stock Item"
msgstr "" msgstr ""

View File

@ -12,6 +12,7 @@ from django.views.generic import DetailView, ListView
from django.forms import HiddenInput from django.forms import HiddenInput
import logging import logging
from decimal import Decimal, InvalidOperation
from .models import PurchaseOrder, PurchaseOrderLineItem from .models import PurchaseOrder, PurchaseOrderLineItem
from .admin import POLineItemResource from .admin import POLineItemResource
@ -324,6 +325,8 @@ class PurchaseOrderReceive(AjaxUpdateView):
self.lines = [] self.lines = []
self.destination = None self.destination = None
msg = _("Items received")
# Extract the destination for received parts # Extract the destination for received parts
if 'location' in request.POST: if 'location' in request.POST:
pk = request.POST['location'] pk = request.POST['location']
@ -332,7 +335,11 @@ class PurchaseOrderReceive(AjaxUpdateView):
except (StockLocation.DoesNotExist, ValueError): except (StockLocation.DoesNotExist, ValueError):
pass 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 # Extract information on all submitted line items
for item in request.POST: for item in request.POST:
@ -359,15 +366,17 @@ class PurchaseOrderReceive(AjaxUpdateView):
receive = self.request.POST[item] receive = self.request.POST[item]
try: try:
receive = int(receive) receive = Decimal(receive)
except ValueError: except InvalidOperation:
# In the case on an invalid input, reset to default # In the case on an invalid input, reset to default
receive = line.remaining() receive = line.remaining()
msg = _("Error converting quantity to number")
errors = True errors = True
if receive < 0: if receive < 0:
receive = 0 receive = 0
errors = True errors = True
msg = _("Receive quantity less than zero")
line.receive_quantity = receive line.receive_quantity = receive
self.lines.append(line) self.lines.append(line)
@ -378,7 +387,7 @@ class PurchaseOrderReceive(AjaxUpdateView):
data = { data = {
'form_valid': errors is False, 'form_valid': errors is False,
'success': 'Items marked as received', 'success': msg,
} }
return self.renderJsonResponse(request, data=data, form=self.get_form()) return self.renderJsonResponse(request, data=data, form=self.get_form())

View File

@ -1,4 +1,5 @@
{% load i18n %} {% load i18n %}
{% load inventree_extras %}
{% block pre_form_content %} {% block pre_form_content %}
@ -14,10 +15,9 @@
<tr> <tr>
<th>{% trans "Stock Item" %}</th> <th>{% trans "Stock Item" %}</th>
<th>{% trans "Location" %}</th> <th>{% trans "Location" %}</th>
<th>{% trans "Quantity" %}</th>
{% if edit_quantity %} {% if edit_quantity %}
<th>{{ stock_action_title }}</th> <th>{{ stock_action_title }}</th>
{% else %}
<th>{% trans "Quantity" %}</th>
{% endif %} {% endif %}
<th></th> <th></th>
</tr> </tr>
@ -26,6 +26,7 @@
<td>{% include "hover_image.html" with image=item.part.image hover=True %} <td>{% include "hover_image.html" with image=item.part.image hover=True %}
{{ item.part.full_name }} <small><i>{{ item.part.description }}</i></small></td> {{ item.part.full_name }} <small><i>{{ item.part.description }}</i></small></td>
<td>{{ item.location.pathstring }}</td> <td>{{ item.location.pathstring }}</td>
<td>{% decimal item.quantity %}</td>
<td> <td>
{% if edit_quantity %} {% if edit_quantity %}
<input class='numberinput' <input class='numberinput'
@ -36,7 +37,6 @@
<br><span class='help-inline'>{{ item.error }}</span> <br><span class='help-inline'>{{ item.error }}</span>
{% endif %} {% endif %}
{% else %} {% else %}
{{ item.new_quantity }}
<input type='hidden' name='stock-id-{{ item.id }}' value='{{ item.new_quantity }}'/> <input type='hidden' name='stock-id-{{ item.id }}' value='{{ item.new_quantity }}'/>
{% endif %} {% endif %}
</td> </td>