Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2020-05-11 23:10:29 +10:00
commit c5999f7186
17 changed files with 611 additions and 209 deletions

View File

@ -6,7 +6,7 @@ import subprocess
from common.models import InvenTreeSetting
import django
INVENTREE_SW_VERSION = "0.1.0 pre"
INVENTREE_SW_VERSION = "0.1.1 pre"
def inventreeInstanceName():

View File

@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-03 09:34+0000\n"
"POT-Creation-Date: 2020-05-04 09:50+0000\n"
"PO-Revision-Date: 2020-05-03 11:32+0200\n"
"Last-Translator: Christian Schlüter <chschlue@gmail.com>\n"
"Language-Team: C <kde-i18n-doc@kde.org>\n"
@ -95,64 +95,68 @@ msgstr "Französisch"
msgid "Polish"
msgstr "Polnisch"
#: InvenTree/status_codes.py:90 InvenTree/status_codes.py:131
#: InvenTree/status_codes.py:213
#: InvenTree/status_codes.py:94 InvenTree/status_codes.py:135
#: InvenTree/status_codes.py:230
msgid "Pending"
msgstr "Ausstehend"
#: InvenTree/status_codes.py:91
#: InvenTree/status_codes.py:95
msgid "Placed"
msgstr "Platziert"
#: InvenTree/status_codes.py:92 InvenTree/status_codes.py:216
#: InvenTree/status_codes.py:96 InvenTree/status_codes.py:233
msgid "Complete"
msgstr "Fertig"
#: InvenTree/status_codes.py:93 InvenTree/status_codes.py:133
#: InvenTree/status_codes.py:215
#: InvenTree/status_codes.py:97 InvenTree/status_codes.py:137
#: InvenTree/status_codes.py:232
msgid "Cancelled"
msgstr "Storniert"
#: InvenTree/status_codes.py:94 InvenTree/status_codes.py:134
#: InvenTree/status_codes.py:169
#: InvenTree/status_codes.py:98 InvenTree/status_codes.py:138
#: InvenTree/status_codes.py:174
msgid "Lost"
msgstr "Verloren"
#: InvenTree/status_codes.py:95 InvenTree/status_codes.py:135
#: InvenTree/status_codes.py:170
#: InvenTree/status_codes.py:99 InvenTree/status_codes.py:139
#: InvenTree/status_codes.py:176
msgid "Returned"
msgstr "Zurückgegeben"
#: InvenTree/status_codes.py:132 InvenTree/status_codes.py:171
#: InvenTree/status_codes.py:136 InvenTree/status_codes.py:177
#: order/templates/order/sales_order_base.html:98
msgid "Shipped"
msgstr "Versendet"
#: InvenTree/status_codes.py:165
#: InvenTree/status_codes.py:170
msgid "OK"
msgstr "OK"
#: InvenTree/status_codes.py:166
#: InvenTree/status_codes.py:171
msgid "Attention needed"
msgstr "erfordert Eingriff"
#: InvenTree/status_codes.py:167
#: InvenTree/status_codes.py:172
msgid "Damaged"
msgstr "Beschädigt"
#: InvenTree/status_codes.py:168
#: InvenTree/status_codes.py:173
msgid "Destroyed"
msgstr "Zerstört"
#: InvenTree/status_codes.py:172
#: InvenTree/status_codes.py:175
msgid "Rejected"
msgstr ""
#: InvenTree/status_codes.py:178
msgid "Used for Build"
msgstr "Verwendet für Bau"
#: InvenTree/status_codes.py:173
#: InvenTree/status_codes.py:179
msgid "Installed in Stock Item"
msgstr "In Lagerobjekt installiert"
#: InvenTree/status_codes.py:214 build/templates/build/allocate.html:349
#: InvenTree/status_codes.py:231 build/templates/build/allocate.html:349
#: order/templates/order/sales_order_detail.html:220
#: part/templates/part/tabs.html:21 templates/js/build.html:120
msgid "Allocated"
@ -218,9 +222,10 @@ msgstr "Eltern-Bau, dem dieser Bau zugewiesen ist"
#: build/models.py:74 build/templates/build/allocate.html:320
#: build/templates/build/auto_allocate.html:18
#: build/templates/build/build_base.html:70
#: build/templates/build/detail.html:22 order/models.py:462
#: build/templates/build/detail.html:22 order/models.py:464
#: order/templates/order/order_wizard/select_parts.html:30
#: order/templates/order/purchase_order_detail.html:145
#: order/templates/order/receive_parts.html:19
#: part/templates/part/part_app_base.html:7
#: part/templates/part/set_category.html:13 templates/js/bom.html:135
#: templates/js/build.html:41 templates/js/company.html:109
@ -312,11 +317,11 @@ msgid "Allocated quantity ({n}) must not exceed available quantity ({q})"
msgstr ""
"zugewiesene Anzahl ({n}) darf nicht die verfügbare ({q}) Anzahl überschreiten"
#: build/models.py:460 order/models.py:546
#: build/models.py:460 order/models.py:548
msgid "StockItem is over-allocated"
msgstr "Zu viele Lagerobjekte zugewiesen"
#: build/models.py:463 order/models.py:549
#: build/models.py:463 order/models.py:551
msgid "Allocation quantity must be greater than zero"
msgstr "Anzahl muss größer null sein"
@ -337,7 +342,7 @@ msgid "Stock quantity to allocate to build"
msgstr "Lagerobjekt-Anzahl dem Bau zuweisen"
#: build/templates/build/allocate.html:17
#: company/templates/company/detail_part.html:18 order/views.py:743
#: company/templates/company/detail_part.html:18 order/views.py:763
msgid "Order Parts"
msgstr "Teile bestellen"
@ -485,13 +490,14 @@ msgstr "Bau-Status"
#: build/templates/build/build_base.html:80
#: build/templates/build/detail.html:42
#: order/templates/order/receive_parts.html:24
#: stock/templates/stock/item_base.html:221 templates/js/build.html:57
#: templates/js/order.html:162 templates/js/order.html:235
#: templates/js/stock.html:264
msgid "Status"
msgstr "Status"
#: build/templates/build/build_base.html:93 order/models.py:460
#: build/templates/build/build_base.html:93 order/models.py:462
#: order/templates/order/sales_order_base.html:9
#: order/templates/order/sales_order_base.html:33
#: order/templates/order/sales_order_notes.html:10
@ -908,7 +914,7 @@ msgstr "Hersteller"
msgid "Supplier"
msgstr "Zulieferer"
#: company/templates/company/detail.html:26 order/models.py:275
#: company/templates/company/detail.html:26 order/models.py:277
#: order/templates/order/sales_order_base.html:73 templates/js/company.html:44
#: templates/js/order.html:217
msgid "Customer"
@ -920,11 +926,12 @@ msgstr "Zulieferer-Teile"
#: company/templates/company/detail_part.html:13
#: order/templates/order/purchase_order_detail.html:67
#: part/templates/part/stock.html:82
#: part/templates/part/stock.html:82 part/templates/part/supplier.html:12
msgid "New Supplier Part"
msgstr "Neues Zulieferer-Teil"
#: company/templates/company/detail_part.html:15 templates/stock_table.html:10
#: company/templates/company/detail_part.html:15
#: part/templates/part/supplier.html:14 templates/stock_table.html:10
msgid "Options"
msgstr "Optionen"
@ -942,6 +949,7 @@ msgid "Create new Part"
msgstr "Neues Teil hinzufügen"
#: company/templates/company/detail_part.html:49 company/views.py:51
#: part/templates/part/supplier.html:44
msgid "New Supplier"
msgstr "Neuer Zulieferer"
@ -950,6 +958,7 @@ msgid "Create new Supplier"
msgstr "Neuen Zulieferer anlegen"
#: company/templates/company/detail_part.html:55 company/views.py:57
#: part/templates/part/supplier.html:50
msgid "New Manufacturer"
msgstr "Neuer Hersteller"
@ -1128,8 +1137,10 @@ msgstr "Lagerbestand"
msgid "Orders"
msgstr "Bestellungen"
#: company/templates/company/tabs.html:9 part/templates/part/category.html:83
#: templates/navbar.html:10 templates/stats.html:8 templates/stats.html:17
#: company/templates/company/tabs.html:9
#: order/templates/order/receive_parts.html:14
#: part/templates/part/category.html:83 templates/navbar.html:10
#: templates/stats.html:8 templates/stats.html:17
msgid "Parts"
msgstr "Teile"
@ -1272,61 +1283,61 @@ msgstr "Teile-Zulieferer muss dem Zulieferer des Kaufvertrags entsprechen"
msgid "Lines can only be received against an order marked as 'Placed'"
msgstr "Nur Teile aufgegebener Bestllungen können empfangen werden"
#: order/models.py:281
#: order/models.py:283
msgid "Customer order reference code"
msgstr "Bestellreferenz"
#: order/models.py:320
#: order/models.py:322
msgid "SalesOrder cannot be shipped as it is not currently pending"
msgstr "Bestellung kann nicht versendet werden weil sie nicht anhängig ist"
#: order/models.py:397
#: order/models.py:399
msgid "Item quantity"
msgstr "Anzahl"
#: order/models.py:399
#: order/models.py:401
msgid "Line item reference"
msgstr "Position - Referenz"
#: order/models.py:401
#: order/models.py:403
msgid "Line item notes"
msgstr "Position - Notizen"
#: order/models.py:427 order/templates/order/order_base.html:9
#: order/models.py:429 order/templates/order/order_base.html:9
#: order/templates/order/order_base.html:23
#: stock/templates/stock/item_base.html:175 templates/js/order.html:136
msgid "Purchase Order"
msgstr "Kaufvertrag"
#: order/models.py:440
#: order/models.py:442
msgid "Supplier part"
msgstr "Zulieferer-Teil"
#: order/models.py:443
#: order/models.py:445
msgid "Number of items received"
msgstr "Empfangene Objekt-Anzahl"
#: order/models.py:537
#: order/models.py:539
msgid "Cannot allocate stock item to a line with a different part"
msgstr "Kann Lagerobjekt keiner Zeile mit einem anderen Teil hinzufügen"
#: order/models.py:539
#: order/models.py:541
msgid "Cannot allocate stock to a line without a part"
msgstr "Kann Lagerobjekt keiner Zeile ohne Teil hinzufügen"
#: order/models.py:542
#: order/models.py:544
msgid "Allocation quantity cannot exceed stock quantity"
msgstr "zugewiesene Anzahl darf nicht die verfügbare Anzahl überschreiten"
#: order/models.py:552
#: order/models.py:554
msgid "Quantity must be 1 for serialized stock item"
msgstr "Anzahl muss 1 für Objekte mit Seriennummer sein"
#: order/models.py:569
#: order/models.py:571
msgid "Select stock item to allocate"
msgstr "Lagerobjekt für Zuordnung auswählen"
#: order/models.py:572
#: order/models.py:574
msgid "Enter stock allocation quantity"
msgstr "Zuordnungsanzahl eingeben"
@ -1359,6 +1370,7 @@ msgstr "Aufgegeben"
#: order/templates/order/order_base.html:106
#: order/templates/order/purchase_order_detail.html:180
#: order/templates/order/receive_parts.html:22
#: order/templates/order/sales_order_base.html:105
msgid "Received"
msgstr "Empfangen"
@ -1458,8 +1470,8 @@ msgid "Attachments"
msgstr "Anhänge"
#: order/templates/order/purchase_order_detail.html:16
#: order/templates/order/sales_order_detail.html:17 order/views.py:1051
#: order/views.py:1165
#: order/templates/order/sales_order_detail.html:17 order/views.py:1071
#: order/views.py:1185
msgid "Add Line Item"
msgstr "Position hinzufügen"
@ -1482,6 +1494,7 @@ msgid "No line items found"
msgstr "Keine Positionen gefunden"
#: order/templates/order/purchase_order_detail.html:162
#: order/templates/order/receive_parts.html:20
msgid "Order Code"
msgstr "Bestellnummer"
@ -1498,6 +1511,29 @@ msgstr "Position löschen"
msgid "Receive line item"
msgstr "Position empfangen"
#: order/templates/order/receive_parts.html:8
msgid "Receive outstanding parts for"
msgstr ""
#: order/templates/order/receive_parts.html:15
msgid "Select parts to receive against this order"
msgstr ""
#: order/templates/order/receive_parts.html:21
#: part/templates/part/part_base.html:128 templates/js/part.html:210
msgid "On Order"
msgstr "bestellt"
#: order/templates/order/receive_parts.html:23
#, fuzzy
#| msgid "Received"
msgid "Receive"
msgstr "Empfangen"
#: order/templates/order/receive_parts.html:36
msgid "Error: Referenced part has been removed"
msgstr ""
#: order/templates/order/sales_order_base.html:15
msgid "This SalesOrder has not been fully allocated"
msgstr "Dieser Auftrag ist nicht vollständig zugeordnet"
@ -1673,51 +1709,51 @@ msgstr "Anzahl empfangener Positionen"
msgid "No destination set"
msgstr "Kein Ziel gesetzt"
#: order/views.py:691
#: order/views.py:705
msgid "Error converting quantity to number"
msgstr "Fehler beim Konvertieren zu Zahl"
#: order/views.py:697
#: order/views.py:711
msgid "Receive quantity less than zero"
msgstr "Anzahl kleiner null empfangen"
#: order/views.py:703
#: order/views.py:717
msgid "No lines specified"
msgstr "Keine Zeilen angegeben"
#: order/views.py:1071
#: order/views.py:1091
msgid "Invalid Purchase Order"
msgstr "Ungültige Bestellung"
#: order/views.py:1079
#: order/views.py:1099
msgid "Supplier must match for Part and Order"
msgstr "Zulieferer muss zum Teil und zur Bestellung passen"
#: order/views.py:1084
#: order/views.py:1104
msgid "Invalid SupplierPart selection"
msgstr "Ungültige Wahl des Zulieferer-Teils"
#: order/views.py:1216 order/views.py:1234
#: order/views.py:1236 order/views.py:1254
msgid "Edit Line Item"
msgstr "Position bearbeiten"
#: order/views.py:1250 order/views.py:1262
#: order/views.py:1270 order/views.py:1282
msgid "Delete Line Item"
msgstr "Position löschen"
#: order/views.py:1255 order/views.py:1267
#: order/views.py:1275 order/views.py:1287
msgid "Deleted line item"
msgstr "Position gelöscht"
#: order/views.py:1276
#: order/views.py:1296
msgid "Allocate Stock to Order"
msgstr "Lagerbestand dem Auftrag zuweisen"
#: order/views.py:1345
#: order/views.py:1365
msgid "Edit Allocation Quantity"
msgstr "Zuordnung bearbeiten"
#: order/views.py:1360
#: order/views.py:1380
msgid "Remove allocation"
msgstr "Zuordnung entfernen"
@ -2195,7 +2231,7 @@ msgstr "Wert"
msgid "Edit"
msgstr "Bearbeiten"
#: part/templates/part/params.html:34
#: part/templates/part/params.html:34 part/templates/part/supplier.html:17
msgid "Delete"
msgstr "Löschen"
@ -2249,10 +2285,6 @@ msgstr "Zu Bauaufträgen zugeordnet"
msgid "Allocated to Sales Orders"
msgstr "Zu Aufträgen zugeordnet"
#: part/templates/part/part_base.html:128 templates/js/part.html:210
msgid "On Order"
msgstr "bestellt"
#: part/templates/part/part_base.html:143
msgid "Can Build"
msgstr "Herstellbar?"
@ -2269,11 +2301,11 @@ msgstr "Aus vorhandenen Bildern auswählen"
msgid "Upload new image"
msgstr "Neues Bild hochladen"
#: part/templates/part/sales_orders.html:14
#: part/templates/part/sales_orders.html:15
msgid "New sales order"
msgstr "Neuer Auftrag"
#: part/templates/part/sales_orders.html:14
#: part/templates/part/sales_orders.html:15
msgid "New Order"
msgstr "Neue Bestellung"
@ -2302,6 +2334,30 @@ msgstr "Kein Bestand"
msgid "Low Stock"
msgstr "Niedriger Bestand"
#: part/templates/part/supplier.html:8
#, fuzzy
#| msgid "Suppliers"
msgid "Part Suppliers"
msgstr "Zulieferer"
#: part/templates/part/supplier.html:17
#, fuzzy
#| msgid "Delete supplier part"
msgid "Delete supplier parts"
msgstr "Zuliefererteil entfernen"
#: part/templates/part/supplier.html:45
#, fuzzy
#| msgid "Create new Supplier"
msgid "Create new supplier"
msgstr "Neuen Zulieferer anlegen"
#: part/templates/part/supplier.html:51
#, fuzzy
#| msgid "Create new Manufacturer"
msgid "Create new manufacturer"
msgstr "Neuen Hersteller anlegen"
#: part/templates/part/tabs.html:9
msgid "Parameters"
msgstr "Parameter"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-03 09:34+0000\n"
"POT-Creation-Date: 2020-05-04 09:50+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -94,64 +94,68 @@ msgstr ""
msgid "Polish"
msgstr ""
#: InvenTree/status_codes.py:90 InvenTree/status_codes.py:131
#: InvenTree/status_codes.py:213
#: InvenTree/status_codes.py:94 InvenTree/status_codes.py:135
#: InvenTree/status_codes.py:230
msgid "Pending"
msgstr ""
#: InvenTree/status_codes.py:91
#: InvenTree/status_codes.py:95
msgid "Placed"
msgstr ""
#: InvenTree/status_codes.py:92 InvenTree/status_codes.py:216
#: InvenTree/status_codes.py:96 InvenTree/status_codes.py:233
msgid "Complete"
msgstr ""
#: InvenTree/status_codes.py:93 InvenTree/status_codes.py:133
#: InvenTree/status_codes.py:215
#: InvenTree/status_codes.py:97 InvenTree/status_codes.py:137
#: InvenTree/status_codes.py:232
msgid "Cancelled"
msgstr ""
#: InvenTree/status_codes.py:94 InvenTree/status_codes.py:134
#: InvenTree/status_codes.py:169
#: InvenTree/status_codes.py:98 InvenTree/status_codes.py:138
#: InvenTree/status_codes.py:174
msgid "Lost"
msgstr ""
#: InvenTree/status_codes.py:95 InvenTree/status_codes.py:135
#: InvenTree/status_codes.py:170
#: InvenTree/status_codes.py:99 InvenTree/status_codes.py:139
#: InvenTree/status_codes.py:176
msgid "Returned"
msgstr ""
#: InvenTree/status_codes.py:132 InvenTree/status_codes.py:171
#: InvenTree/status_codes.py:136 InvenTree/status_codes.py:177
#: order/templates/order/sales_order_base.html:98
msgid "Shipped"
msgstr ""
#: InvenTree/status_codes.py:165
#: InvenTree/status_codes.py:170
msgid "OK"
msgstr ""
#: InvenTree/status_codes.py:166
#: InvenTree/status_codes.py:171
msgid "Attention needed"
msgstr ""
#: InvenTree/status_codes.py:167
#: InvenTree/status_codes.py:172
msgid "Damaged"
msgstr ""
#: InvenTree/status_codes.py:168
#: InvenTree/status_codes.py:173
msgid "Destroyed"
msgstr ""
#: InvenTree/status_codes.py:172
#: InvenTree/status_codes.py:175
msgid "Rejected"
msgstr ""
#: InvenTree/status_codes.py:178
msgid "Used for Build"
msgstr ""
#: InvenTree/status_codes.py:173
#: InvenTree/status_codes.py:179
msgid "Installed in Stock Item"
msgstr ""
#: InvenTree/status_codes.py:214 build/templates/build/allocate.html:349
#: InvenTree/status_codes.py:231 build/templates/build/allocate.html:349
#: order/templates/order/sales_order_detail.html:220
#: part/templates/part/tabs.html:21 templates/js/build.html:120
msgid "Allocated"
@ -217,9 +221,10 @@ msgstr ""
#: build/models.py:74 build/templates/build/allocate.html:320
#: build/templates/build/auto_allocate.html:18
#: build/templates/build/build_base.html:70
#: build/templates/build/detail.html:22 order/models.py:462
#: build/templates/build/detail.html:22 order/models.py:464
#: order/templates/order/order_wizard/select_parts.html:30
#: order/templates/order/purchase_order_detail.html:145
#: order/templates/order/receive_parts.html:19
#: part/templates/part/part_app_base.html:7
#: part/templates/part/set_category.html:13 templates/js/bom.html:135
#: templates/js/build.html:41 templates/js/company.html:109
@ -308,11 +313,11 @@ msgstr ""
msgid "Allocated quantity ({n}) must not exceed available quantity ({q})"
msgstr ""
#: build/models.py:460 order/models.py:546
#: build/models.py:460 order/models.py:548
msgid "StockItem is over-allocated"
msgstr ""
#: build/models.py:463 order/models.py:549
#: build/models.py:463 order/models.py:551
msgid "Allocation quantity must be greater than zero"
msgstr ""
@ -333,7 +338,7 @@ msgid "Stock quantity to allocate to build"
msgstr ""
#: build/templates/build/allocate.html:17
#: company/templates/company/detail_part.html:18 order/views.py:743
#: company/templates/company/detail_part.html:18 order/views.py:763
msgid "Order Parts"
msgstr ""
@ -480,13 +485,14 @@ msgstr ""
#: build/templates/build/build_base.html:80
#: build/templates/build/detail.html:42
#: order/templates/order/receive_parts.html:24
#: stock/templates/stock/item_base.html:221 templates/js/build.html:57
#: templates/js/order.html:162 templates/js/order.html:235
#: templates/js/stock.html:264
msgid "Status"
msgstr ""
#: build/templates/build/build_base.html:93 order/models.py:460
#: build/templates/build/build_base.html:93 order/models.py:462
#: order/templates/order/sales_order_base.html:9
#: order/templates/order/sales_order_base.html:33
#: order/templates/order/sales_order_notes.html:10
@ -898,7 +904,7 @@ msgstr ""
msgid "Supplier"
msgstr ""
#: company/templates/company/detail.html:26 order/models.py:275
#: company/templates/company/detail.html:26 order/models.py:277
#: order/templates/order/sales_order_base.html:73 templates/js/company.html:44
#: templates/js/order.html:217
msgid "Customer"
@ -910,11 +916,12 @@ msgstr ""
#: company/templates/company/detail_part.html:13
#: order/templates/order/purchase_order_detail.html:67
#: part/templates/part/stock.html:82
#: part/templates/part/stock.html:82 part/templates/part/supplier.html:12
msgid "New Supplier Part"
msgstr ""
#: company/templates/company/detail_part.html:15 templates/stock_table.html:10
#: company/templates/company/detail_part.html:15
#: part/templates/part/supplier.html:14 templates/stock_table.html:10
msgid "Options"
msgstr ""
@ -932,6 +939,7 @@ msgid "Create new Part"
msgstr ""
#: company/templates/company/detail_part.html:49 company/views.py:51
#: part/templates/part/supplier.html:44
msgid "New Supplier"
msgstr ""
@ -940,6 +948,7 @@ msgid "Create new Supplier"
msgstr ""
#: company/templates/company/detail_part.html:55 company/views.py:57
#: part/templates/part/supplier.html:50
msgid "New Manufacturer"
msgstr ""
@ -1117,8 +1126,10 @@ msgstr ""
msgid "Orders"
msgstr ""
#: company/templates/company/tabs.html:9 part/templates/part/category.html:83
#: templates/navbar.html:10 templates/stats.html:8 templates/stats.html:17
#: company/templates/company/tabs.html:9
#: order/templates/order/receive_parts.html:14
#: part/templates/part/category.html:83 templates/navbar.html:10
#: templates/stats.html:8 templates/stats.html:17
msgid "Parts"
msgstr ""
@ -1261,61 +1272,61 @@ msgstr ""
msgid "Lines can only be received against an order marked as 'Placed'"
msgstr ""
#: order/models.py:281
#: order/models.py:283
msgid "Customer order reference code"
msgstr ""
#: order/models.py:320
#: order/models.py:322
msgid "SalesOrder cannot be shipped as it is not currently pending"
msgstr ""
#: order/models.py:397
#: order/models.py:399
msgid "Item quantity"
msgstr ""
#: order/models.py:399
#: order/models.py:401
msgid "Line item reference"
msgstr ""
#: order/models.py:401
#: order/models.py:403
msgid "Line item notes"
msgstr ""
#: order/models.py:427 order/templates/order/order_base.html:9
#: order/models.py:429 order/templates/order/order_base.html:9
#: order/templates/order/order_base.html:23
#: stock/templates/stock/item_base.html:175 templates/js/order.html:136
msgid "Purchase Order"
msgstr ""
#: order/models.py:440
#: order/models.py:442
msgid "Supplier part"
msgstr ""
#: order/models.py:443
#: order/models.py:445
msgid "Number of items received"
msgstr ""
#: order/models.py:537
#: order/models.py:539
msgid "Cannot allocate stock item to a line with a different part"
msgstr ""
#: order/models.py:539
#: order/models.py:541
msgid "Cannot allocate stock to a line without a part"
msgstr ""
#: order/models.py:542
#: order/models.py:544
msgid "Allocation quantity cannot exceed stock quantity"
msgstr ""
#: order/models.py:552
#: order/models.py:554
msgid "Quantity must be 1 for serialized stock item"
msgstr ""
#: order/models.py:569
#: order/models.py:571
msgid "Select stock item to allocate"
msgstr ""
#: order/models.py:572
#: order/models.py:574
msgid "Enter stock allocation quantity"
msgstr ""
@ -1348,6 +1359,7 @@ msgstr ""
#: order/templates/order/order_base.html:106
#: order/templates/order/purchase_order_detail.html:180
#: order/templates/order/receive_parts.html:22
#: order/templates/order/sales_order_base.html:105
msgid "Received"
msgstr ""
@ -1446,8 +1458,8 @@ msgid "Attachments"
msgstr ""
#: order/templates/order/purchase_order_detail.html:16
#: order/templates/order/sales_order_detail.html:17 order/views.py:1051
#: order/views.py:1165
#: order/templates/order/sales_order_detail.html:17 order/views.py:1071
#: order/views.py:1185
msgid "Add Line Item"
msgstr ""
@ -1470,6 +1482,7 @@ msgid "No line items found"
msgstr ""
#: order/templates/order/purchase_order_detail.html:162
#: order/templates/order/receive_parts.html:20
msgid "Order Code"
msgstr ""
@ -1486,6 +1499,27 @@ msgstr ""
msgid "Receive line item"
msgstr ""
#: order/templates/order/receive_parts.html:8
msgid "Receive outstanding parts for"
msgstr ""
#: order/templates/order/receive_parts.html:15
msgid "Select parts to receive against this order"
msgstr ""
#: order/templates/order/receive_parts.html:21
#: part/templates/part/part_base.html:128 templates/js/part.html:210
msgid "On Order"
msgstr ""
#: order/templates/order/receive_parts.html:23
msgid "Receive"
msgstr ""
#: order/templates/order/receive_parts.html:36
msgid "Error: Referenced part has been removed"
msgstr ""
#: order/templates/order/sales_order_base.html:15
msgid "This SalesOrder has not been fully allocated"
msgstr ""
@ -1657,51 +1691,51 @@ msgstr ""
msgid "No destination set"
msgstr ""
#: order/views.py:691
#: order/views.py:705
msgid "Error converting quantity to number"
msgstr ""
#: order/views.py:697
#: order/views.py:711
msgid "Receive quantity less than zero"
msgstr ""
#: order/views.py:703
#: order/views.py:717
msgid "No lines specified"
msgstr ""
#: order/views.py:1071
#: order/views.py:1091
msgid "Invalid Purchase Order"
msgstr ""
#: order/views.py:1079
#: order/views.py:1099
msgid "Supplier must match for Part and Order"
msgstr ""
#: order/views.py:1084
#: order/views.py:1104
msgid "Invalid SupplierPart selection"
msgstr ""
#: order/views.py:1216 order/views.py:1234
#: order/views.py:1236 order/views.py:1254
msgid "Edit Line Item"
msgstr ""
#: order/views.py:1250 order/views.py:1262
#: order/views.py:1270 order/views.py:1282
msgid "Delete Line Item"
msgstr ""
#: order/views.py:1255 order/views.py:1267
#: order/views.py:1275 order/views.py:1287
msgid "Deleted line item"
msgstr ""
#: order/views.py:1276
#: order/views.py:1296
msgid "Allocate Stock to Order"
msgstr ""
#: order/views.py:1345
#: order/views.py:1365
msgid "Edit Allocation Quantity"
msgstr ""
#: order/views.py:1360
#: order/views.py:1380
msgid "Remove allocation"
msgstr ""
@ -2175,7 +2209,7 @@ msgstr ""
msgid "Edit"
msgstr ""
#: part/templates/part/params.html:34
#: part/templates/part/params.html:34 part/templates/part/supplier.html:17
msgid "Delete"
msgstr ""
@ -2228,10 +2262,6 @@ msgstr ""
msgid "Allocated to Sales Orders"
msgstr ""
#: part/templates/part/part_base.html:128 templates/js/part.html:210
msgid "On Order"
msgstr ""
#: part/templates/part/part_base.html:143
msgid "Can Build"
msgstr ""
@ -2248,11 +2278,11 @@ msgstr ""
msgid "Upload new image"
msgstr ""
#: part/templates/part/sales_orders.html:14
#: part/templates/part/sales_orders.html:15
msgid "New sales order"
msgstr ""
#: part/templates/part/sales_orders.html:14
#: part/templates/part/sales_orders.html:15
msgid "New Order"
msgstr ""
@ -2281,6 +2311,22 @@ msgstr ""
msgid "Low Stock"
msgstr ""
#: part/templates/part/supplier.html:8
msgid "Part Suppliers"
msgstr ""
#: part/templates/part/supplier.html:17
msgid "Delete supplier parts"
msgstr ""
#: part/templates/part/supplier.html:45
msgid "Create new supplier"
msgstr ""
#: part/templates/part/supplier.html:51
msgid "Create new manufacturer"
msgstr ""
#: part/templates/part/tabs.html:9
msgid "Parameters"
msgstr ""

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-05-03 09:34+0000\n"
"POT-Creation-Date: 2020-05-04 09:50+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -94,64 +94,68 @@ msgstr ""
msgid "Polish"
msgstr ""
#: InvenTree/status_codes.py:90 InvenTree/status_codes.py:131
#: InvenTree/status_codes.py:213
#: InvenTree/status_codes.py:94 InvenTree/status_codes.py:135
#: InvenTree/status_codes.py:230
msgid "Pending"
msgstr ""
#: InvenTree/status_codes.py:91
#: InvenTree/status_codes.py:95
msgid "Placed"
msgstr ""
#: InvenTree/status_codes.py:92 InvenTree/status_codes.py:216
#: InvenTree/status_codes.py:96 InvenTree/status_codes.py:233
msgid "Complete"
msgstr ""
#: InvenTree/status_codes.py:93 InvenTree/status_codes.py:133
#: InvenTree/status_codes.py:215
#: InvenTree/status_codes.py:97 InvenTree/status_codes.py:137
#: InvenTree/status_codes.py:232
msgid "Cancelled"
msgstr ""
#: InvenTree/status_codes.py:94 InvenTree/status_codes.py:134
#: InvenTree/status_codes.py:169
#: InvenTree/status_codes.py:98 InvenTree/status_codes.py:138
#: InvenTree/status_codes.py:174
msgid "Lost"
msgstr ""
#: InvenTree/status_codes.py:95 InvenTree/status_codes.py:135
#: InvenTree/status_codes.py:170
#: InvenTree/status_codes.py:99 InvenTree/status_codes.py:139
#: InvenTree/status_codes.py:176
msgid "Returned"
msgstr ""
#: InvenTree/status_codes.py:132 InvenTree/status_codes.py:171
#: InvenTree/status_codes.py:136 InvenTree/status_codes.py:177
#: order/templates/order/sales_order_base.html:98
msgid "Shipped"
msgstr ""
#: InvenTree/status_codes.py:165
#: InvenTree/status_codes.py:170
msgid "OK"
msgstr ""
#: InvenTree/status_codes.py:166
#: InvenTree/status_codes.py:171
msgid "Attention needed"
msgstr ""
#: InvenTree/status_codes.py:167
#: InvenTree/status_codes.py:172
msgid "Damaged"
msgstr ""
#: InvenTree/status_codes.py:168
#: InvenTree/status_codes.py:173
msgid "Destroyed"
msgstr ""
#: InvenTree/status_codes.py:172
#: InvenTree/status_codes.py:175
msgid "Rejected"
msgstr ""
#: InvenTree/status_codes.py:178
msgid "Used for Build"
msgstr ""
#: InvenTree/status_codes.py:173
#: InvenTree/status_codes.py:179
msgid "Installed in Stock Item"
msgstr ""
#: InvenTree/status_codes.py:214 build/templates/build/allocate.html:349
#: InvenTree/status_codes.py:231 build/templates/build/allocate.html:349
#: order/templates/order/sales_order_detail.html:220
#: part/templates/part/tabs.html:21 templates/js/build.html:120
msgid "Allocated"
@ -217,9 +221,10 @@ msgstr ""
#: build/models.py:74 build/templates/build/allocate.html:320
#: build/templates/build/auto_allocate.html:18
#: build/templates/build/build_base.html:70
#: build/templates/build/detail.html:22 order/models.py:462
#: build/templates/build/detail.html:22 order/models.py:464
#: order/templates/order/order_wizard/select_parts.html:30
#: order/templates/order/purchase_order_detail.html:145
#: order/templates/order/receive_parts.html:19
#: part/templates/part/part_app_base.html:7
#: part/templates/part/set_category.html:13 templates/js/bom.html:135
#: templates/js/build.html:41 templates/js/company.html:109
@ -308,11 +313,11 @@ msgstr ""
msgid "Allocated quantity ({n}) must not exceed available quantity ({q})"
msgstr ""
#: build/models.py:460 order/models.py:546
#: build/models.py:460 order/models.py:548
msgid "StockItem is over-allocated"
msgstr ""
#: build/models.py:463 order/models.py:549
#: build/models.py:463 order/models.py:551
msgid "Allocation quantity must be greater than zero"
msgstr ""
@ -333,7 +338,7 @@ msgid "Stock quantity to allocate to build"
msgstr ""
#: build/templates/build/allocate.html:17
#: company/templates/company/detail_part.html:18 order/views.py:743
#: company/templates/company/detail_part.html:18 order/views.py:763
msgid "Order Parts"
msgstr ""
@ -480,13 +485,14 @@ msgstr ""
#: build/templates/build/build_base.html:80
#: build/templates/build/detail.html:42
#: order/templates/order/receive_parts.html:24
#: stock/templates/stock/item_base.html:221 templates/js/build.html:57
#: templates/js/order.html:162 templates/js/order.html:235
#: templates/js/stock.html:264
msgid "Status"
msgstr ""
#: build/templates/build/build_base.html:93 order/models.py:460
#: build/templates/build/build_base.html:93 order/models.py:462
#: order/templates/order/sales_order_base.html:9
#: order/templates/order/sales_order_base.html:33
#: order/templates/order/sales_order_notes.html:10
@ -898,7 +904,7 @@ msgstr ""
msgid "Supplier"
msgstr ""
#: company/templates/company/detail.html:26 order/models.py:275
#: company/templates/company/detail.html:26 order/models.py:277
#: order/templates/order/sales_order_base.html:73 templates/js/company.html:44
#: templates/js/order.html:217
msgid "Customer"
@ -910,11 +916,12 @@ msgstr ""
#: company/templates/company/detail_part.html:13
#: order/templates/order/purchase_order_detail.html:67
#: part/templates/part/stock.html:82
#: part/templates/part/stock.html:82 part/templates/part/supplier.html:12
msgid "New Supplier Part"
msgstr ""
#: company/templates/company/detail_part.html:15 templates/stock_table.html:10
#: company/templates/company/detail_part.html:15
#: part/templates/part/supplier.html:14 templates/stock_table.html:10
msgid "Options"
msgstr ""
@ -932,6 +939,7 @@ msgid "Create new Part"
msgstr ""
#: company/templates/company/detail_part.html:49 company/views.py:51
#: part/templates/part/supplier.html:44
msgid "New Supplier"
msgstr ""
@ -940,6 +948,7 @@ msgid "Create new Supplier"
msgstr ""
#: company/templates/company/detail_part.html:55 company/views.py:57
#: part/templates/part/supplier.html:50
msgid "New Manufacturer"
msgstr ""
@ -1117,8 +1126,10 @@ msgstr ""
msgid "Orders"
msgstr ""
#: company/templates/company/tabs.html:9 part/templates/part/category.html:83
#: templates/navbar.html:10 templates/stats.html:8 templates/stats.html:17
#: company/templates/company/tabs.html:9
#: order/templates/order/receive_parts.html:14
#: part/templates/part/category.html:83 templates/navbar.html:10
#: templates/stats.html:8 templates/stats.html:17
msgid "Parts"
msgstr ""
@ -1261,61 +1272,61 @@ msgstr ""
msgid "Lines can only be received against an order marked as 'Placed'"
msgstr ""
#: order/models.py:281
#: order/models.py:283
msgid "Customer order reference code"
msgstr ""
#: order/models.py:320
#: order/models.py:322
msgid "SalesOrder cannot be shipped as it is not currently pending"
msgstr ""
#: order/models.py:397
#: order/models.py:399
msgid "Item quantity"
msgstr ""
#: order/models.py:399
#: order/models.py:401
msgid "Line item reference"
msgstr ""
#: order/models.py:401
#: order/models.py:403
msgid "Line item notes"
msgstr ""
#: order/models.py:427 order/templates/order/order_base.html:9
#: order/models.py:429 order/templates/order/order_base.html:9
#: order/templates/order/order_base.html:23
#: stock/templates/stock/item_base.html:175 templates/js/order.html:136
msgid "Purchase Order"
msgstr ""
#: order/models.py:440
#: order/models.py:442
msgid "Supplier part"
msgstr ""
#: order/models.py:443
#: order/models.py:445
msgid "Number of items received"
msgstr ""
#: order/models.py:537
#: order/models.py:539
msgid "Cannot allocate stock item to a line with a different part"
msgstr ""
#: order/models.py:539
#: order/models.py:541
msgid "Cannot allocate stock to a line without a part"
msgstr ""
#: order/models.py:542
#: order/models.py:544
msgid "Allocation quantity cannot exceed stock quantity"
msgstr ""
#: order/models.py:552
#: order/models.py:554
msgid "Quantity must be 1 for serialized stock item"
msgstr ""
#: order/models.py:569
#: order/models.py:571
msgid "Select stock item to allocate"
msgstr ""
#: order/models.py:572
#: order/models.py:574
msgid "Enter stock allocation quantity"
msgstr ""
@ -1348,6 +1359,7 @@ msgstr ""
#: order/templates/order/order_base.html:106
#: order/templates/order/purchase_order_detail.html:180
#: order/templates/order/receive_parts.html:22
#: order/templates/order/sales_order_base.html:105
msgid "Received"
msgstr ""
@ -1446,8 +1458,8 @@ msgid "Attachments"
msgstr ""
#: order/templates/order/purchase_order_detail.html:16
#: order/templates/order/sales_order_detail.html:17 order/views.py:1051
#: order/views.py:1165
#: order/templates/order/sales_order_detail.html:17 order/views.py:1071
#: order/views.py:1185
msgid "Add Line Item"
msgstr ""
@ -1470,6 +1482,7 @@ msgid "No line items found"
msgstr ""
#: order/templates/order/purchase_order_detail.html:162
#: order/templates/order/receive_parts.html:20
msgid "Order Code"
msgstr ""
@ -1486,6 +1499,27 @@ msgstr ""
msgid "Receive line item"
msgstr ""
#: order/templates/order/receive_parts.html:8
msgid "Receive outstanding parts for"
msgstr ""
#: order/templates/order/receive_parts.html:15
msgid "Select parts to receive against this order"
msgstr ""
#: order/templates/order/receive_parts.html:21
#: part/templates/part/part_base.html:128 templates/js/part.html:210
msgid "On Order"
msgstr ""
#: order/templates/order/receive_parts.html:23
msgid "Receive"
msgstr ""
#: order/templates/order/receive_parts.html:36
msgid "Error: Referenced part has been removed"
msgstr ""
#: order/templates/order/sales_order_base.html:15
msgid "This SalesOrder has not been fully allocated"
msgstr ""
@ -1657,51 +1691,51 @@ msgstr ""
msgid "No destination set"
msgstr ""
#: order/views.py:691
#: order/views.py:705
msgid "Error converting quantity to number"
msgstr ""
#: order/views.py:697
#: order/views.py:711
msgid "Receive quantity less than zero"
msgstr ""
#: order/views.py:703
#: order/views.py:717
msgid "No lines specified"
msgstr ""
#: order/views.py:1071
#: order/views.py:1091
msgid "Invalid Purchase Order"
msgstr ""
#: order/views.py:1079
#: order/views.py:1099
msgid "Supplier must match for Part and Order"
msgstr ""
#: order/views.py:1084
#: order/views.py:1104
msgid "Invalid SupplierPart selection"
msgstr ""
#: order/views.py:1216 order/views.py:1234
#: order/views.py:1236 order/views.py:1254
msgid "Edit Line Item"
msgstr ""
#: order/views.py:1250 order/views.py:1262
#: order/views.py:1270 order/views.py:1282
msgid "Delete Line Item"
msgstr ""
#: order/views.py:1255 order/views.py:1267
#: order/views.py:1275 order/views.py:1287
msgid "Deleted line item"
msgstr ""
#: order/views.py:1276
#: order/views.py:1296
msgid "Allocate Stock to Order"
msgstr ""
#: order/views.py:1345
#: order/views.py:1365
msgid "Edit Allocation Quantity"
msgstr ""
#: order/views.py:1360
#: order/views.py:1380
msgid "Remove allocation"
msgstr ""
@ -2175,7 +2209,7 @@ msgstr ""
msgid "Edit"
msgstr ""
#: part/templates/part/params.html:34
#: part/templates/part/params.html:34 part/templates/part/supplier.html:17
msgid "Delete"
msgstr ""
@ -2228,10 +2262,6 @@ msgstr ""
msgid "Allocated to Sales Orders"
msgstr ""
#: part/templates/part/part_base.html:128 templates/js/part.html:210
msgid "On Order"
msgstr ""
#: part/templates/part/part_base.html:143
msgid "Can Build"
msgstr ""
@ -2248,11 +2278,11 @@ msgstr ""
msgid "Upload new image"
msgstr ""
#: part/templates/part/sales_orders.html:14
#: part/templates/part/sales_orders.html:15
msgid "New sales order"
msgstr ""
#: part/templates/part/sales_orders.html:14
#: part/templates/part/sales_orders.html:15
msgid "New Order"
msgstr ""
@ -2281,6 +2311,22 @@ msgstr ""
msgid "Low Stock"
msgstr ""
#: part/templates/part/supplier.html:8
msgid "Part Suppliers"
msgstr ""
#: part/templates/part/supplier.html:17
msgid "Delete supplier parts"
msgstr ""
#: part/templates/part/supplier.html:45
msgid "Create new supplier"
msgstr ""
#: part/templates/part/supplier.html:51
msgid "Create new manufacturer"
msgstr ""
#: part/templates/part/tabs.html:9
msgid "Parameters"
msgstr ""

View File

@ -11,7 +11,9 @@
<div id='button-bar'>
<div class='button-toolbar container-fluid' style='float: right;'>
{% if 0 %}
<button class='btn btn-primary' type='button' id='part-order2' title='{% trans "New sales order" %}'>{% trans "New Order" %}</button>
{% endif %}
<div class='filter-list' id='filter-list-salesorder'>
<!-- An empty div in which the filter list will be constructed -->
</div>

View File

@ -1,19 +1,20 @@
{% extends "part/part_base.html" %}
{% load static %}
{% load i18n %}
{% block details %}
{% include 'part/tabs.html' with tab='suppliers' %}
<h4>Part Suppliers</h4>
<h4>{% trans "Part Suppliers" %}</h4>
<hr>
<div id='button-toolbar'>
<button class="btn btn-success" id='supplier-create'>New Supplier Part</button>
<button class="btn btn-success" id='supplier-create'>{% trans "New Supplier Part" %}</button>
<div id='opt-dropdown' class="dropdown" style='float: right;'>
<button id='supplier-part-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">Options
<button id='supplier-part-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}
<span class="caret"></span></button>
<ul class="dropdown-menu">
<li><a href='#' id='supplier-part-delete' title='Delete supplier parts'>Delete</a></li>
<li><a href='#' id='supplier-part-delete' title='{% trans "Delete supplier parts" %}'>{% trans "Delete" %}</a></li>
</ul>
</div>
</div>
@ -40,9 +41,15 @@
secondary: [
{
field: 'supplier',
label: 'New Supplier',
title: 'Create new supplier',
url: "{% url 'company-create' %}"
label: '{% trans "New Supplier" %}',
title: '{% trans "Create new supplier" %}',
url: "{% url 'supplier-create' %}"
},
{
field: 'manufacturer',
label: '{% trans "New Manufacturer" %}',
title: '{% trans "Create new manufacturer" %}',
url: "{% url 'manufacturer-create' %}",
}
]
});

View File

@ -135,7 +135,7 @@ class PartAttachmentDelete(AjaxDeleteView):
model = PartAttachment
ajax_form_title = _("Delete Part Attachment")
ajax_template_name = "part/attachment_delete.html"
ajax_template_name = "attachment_delete.html"
context_object_name = "attachment"
def get_data(self):

View File

@ -8,7 +8,7 @@ from import_export.resources import ModelResource
from import_export.fields import Field
import import_export.widgets as widgets
from .models import StockLocation, StockItem
from .models import StockLocation, StockItem, StockItemAttachment
from .models import StockItemTracking
from build.models import Build
@ -108,6 +108,11 @@ class StockItemAdmin(ImportExportModelAdmin):
list_display = ('part', 'quantity', 'location', 'status', 'updated')
class StockAttachmentAdmin(admin.ModelAdmin):
list_display = ('stock_item', 'attachment', 'comment')
class StockTrackingAdmin(ImportExportModelAdmin):
list_display = ('item', 'date', 'title')
@ -115,3 +120,4 @@ class StockTrackingAdmin(ImportExportModelAdmin):
admin.site.register(StockLocation, LocationAdmin)
admin.site.register(StockItem, StockItemAdmin)
admin.site.register(StockItemTracking, StockTrackingAdmin)
admin.site.register(StockItemAttachment, StockAttachmentAdmin)

View File

@ -13,7 +13,21 @@ from mptt.fields import TreeNodeChoiceField
from InvenTree.helpers import GetExportFormats
from InvenTree.forms import HelperForm
from .models import StockLocation, StockItem, StockItemTracking
from .models import StockLocation, StockItem, StockItemTracking, StockItemAttachment
class EditStockItemAttachmentForm(HelperForm):
"""
Form for creating / editing a StockItemAttachment object
"""
class Meta:
model = StockItemAttachment
fields = [
'stock_item',
'attachment',
'comment'
]
class EditStockLocationForm(HelperForm):

View File

@ -0,0 +1,27 @@
# Generated by Django 3.0.5 on 2020-05-06 23:36
import InvenTree.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('stock', '0035_auto_20200502_2308'),
]
operations = [
migrations.CreateModel(
name='StockItemAttachment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('attachment', models.FileField(help_text='Select file to attach', upload_to=InvenTree.models.rename_attachment)),
('comment', models.CharField(help_text='File comment', max_length=100)),
('stock_item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='stock.StockItem')),
],
options={
'abstract': False,
},
),
]

View File

@ -6,6 +6,8 @@ Stock database model definitions
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.utils.translation import gettext_lazy as _
from django.core.exceptions import ValidationError
from django.urls import reverse
@ -27,7 +29,7 @@ from datetime import datetime
from InvenTree import helpers
from InvenTree.status_codes import StockStatus
from InvenTree.models import InvenTreeTree
from InvenTree.models import InvenTreeTree, InvenTreeAttachment
from InvenTree.fields import InvenTreeURLField
from part import models as PartModels
@ -935,6 +937,21 @@ def before_delete_stock_item(sender, instance, using, **kwargs):
StockItem.objects.rebuild()
class StockItemAttachment(InvenTreeAttachment):
"""
Model for storing file attachments against a StockItem object.
"""
def getSubdir(self):
return os.path.join("stock_files", str(self.stock_item.id))
stock_item = models.ForeignKey(
StockItem,
on_delete=models.CASCADE,
related_name='attachments'
)
class StockItemTracking(models.Model):
""" Stock tracking entry - breacrumb for keeping track of automated stock transactions

View File

@ -0,0 +1,82 @@
{% extends "stock/item_base.html" %}
{% load static %}
{% load i18n %}
{% block details %}
{% include "stock/tabs.html" with tab='attachments' %}
<hr>
<h4>{% trans "Stock Item Attachments" %}</h4>
<div id='attachment-buttons'>
<div class="btn-group">
<button type='button' class='btn btn-success' id='new-attachment'>{% trans "Add Attachment" %}</button>
</div>
</div>
<table class='table table-striped table-condensed' data-toolbar='#attachment-buttons' id='attachment-table'>
<thead>
<tr>
<th data-field='file' data-searchable='true'>{% trans "File" %}</th>
<th data-field='comment' data-searchable='true'>{% trans "Comment" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for attachment in item.attachments.all %}
<tr>
<td><a href='/media/{{ attachment.attachment }}'>{{ attachment.basename }}</a></td>
<td>{{ attachment.comment }}</td>
<td>
<div class='btn-group' style='float: right;'>
<button type='button' class='btn btn-default btn-glyph attachment-edit-button' url="{% url 'stock-item-attachment-edit' attachment.id %}" data-toggle='tooltip' title='{% trans "Edit attachment" %}'>
<span class='fas fa-edit'/>
</button>
<button type='button' class='btn btn-default btn-glyph attachment-delete-button' url="{% url 'stock-item-attachment-delete' attachment.id %}" data-toggle='tooltip' title='{% trans "Delete attachment" %}'>
<span class='fas fa-trash-alt icon-red'/>
</button>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}
{% block js_ready %}
{{ block.super }}
$("#new-attachment").click(function() {
launchModalForm("{% url 'stock-item-attachment-create' %}?item={{ item.id }}",
{
reload: true,
});
});
$("#attachment-table").on('click', '.attachment-edit-button', function() {
var button = $(this);
launchModalForm(button.attr('url'),
{
reload: true,
});
});
$("#attachment-table").on('click', '.attachment-delete-button', function() {
var button = $(this);
launchModalForm(button.attr('url'), {
success: function() {
location.reload();
}
});
});
$("#attachment-table").inventreeTable({
});
{% endblock %}

View File

@ -1,12 +1,15 @@
{% load i18n %}
<ul class='nav nav-tabs'>
<li{% ifequal tab 'tracking' %} class='active'{% endifequal %}>
<a href="{% url 'stock-item-detail' item.id %}">{% trans "Tracking" %}</a>
</li>
<li{% ifequal tab 'children' %} class='active'{% endifequal %}>
<a href="{% url 'stock-item-children' item.id %}">{% trans "Children" %}{% if item.child_count > 0 %}<span class='badge'>{{ item.child_count }}</span>{% endif %}</a>
</li>
<li{% ifequal tab 'tracking' %} class='active'{% endifequal %}>
<a href="{% url 'stock-item-detail' item.id %}">
{% trans "Tracking" %}
{% if item.tracking_info.count > 0 %}<span class='badge'>{{ item.tracking_info.count }}</span>{% endif %}
</a>
</li>
{% if 0 %}
<!-- These tabs are to be implemented in the future -->
<li{% ifequal tab 'builds' %} class='active'{% endifequal %}>
@ -14,6 +17,15 @@
</li>
{% endif %}
<li{% ifequal tab 'notes' %} class='active'{% endifequal %}>
<a href="{% url 'stock-item-notes' item.id %}">{% trans "Notes" %}{% if item.notes %} <span class='fas fa-info-circle'></span>{% endif %}</a>
<a href="{% url 'stock-item-notes' item.id %}">
{% trans "Notes" %}
{% if item.notes %} <span class='fas fa-info-circle'></span>{% endif %}
</a>
</li>
<li{% if tab == 'attachments' %} class='active'{% endif %}>
<a href="{% url 'stock-item-attachments' item.id %}">
{% trans "Attachments" %}
{% if item.attachments.count > 0 %}<span class='badge'>{{ item.attachments.count }}</span>{% endif %}
</a>
</li>
</ul>

View File

@ -25,6 +25,7 @@ stock_item_detail_urls = [
url(r'^add_tracking/', views.StockItemTrackingCreate.as_view(), name='stock-tracking-create'),
url(r'^children/', views.StockItemDetail.as_view(template_name='stock/item_childs.html'), name='stock-item-children'),
url(r'^attachments/', views.StockItemDetail.as_view(template_name='stock/item_attachments.html'), name='stock-item-attachments'),
url(r'^notes/', views.StockItemNotes.as_view(), name='stock-item-notes'),
url('^.*$', views.StockItemDetail.as_view(), name='stock-item-detail'),
@ -50,6 +51,12 @@ stock_urls = [
url(r'^item/new/?', views.StockItemCreate.as_view(), name='stock-item-create'),
url(r'^item/attachment/', include([
url(r'^new/', views.StockItemAttachmentCreate.as_view(), name='stock-item-attachment-create'),
url(r'^(?P<pk>\d+)/edit/', views.StockItemAttachmentEdit.as_view(), name='stock-item-attachment-edit'),
url(r'^(?P<pk>\d+)/delete/', views.StockItemAttachmentDelete.as_view(), name='stock-item-attachment-delete'),
])),
url(r'^track/', include(stock_tracking_urls)),
url(r'^adjust/?', views.StockAdjust.as_view(), name='stock-adjust'),

View File

@ -26,7 +26,7 @@ from datetime import datetime
from company.models import Company, SupplierPart
from part.models import Part
from .models import StockItem, StockLocation, StockItemTracking
from .models import StockItem, StockLocation, StockItemTracking, StockItemAttachment
from .admin import StockItemResource
@ -37,6 +37,7 @@ from .forms import AdjustStockForm
from .forms import TrackingEntryForm
from .forms import SerializeStockForm
from .forms import ExportOptionsForm
from .forms import EditStockItemAttachmentForm
class StockIndex(ListView):
@ -149,6 +150,78 @@ class StockLocationQRCode(QRCodeView):
return None
class StockItemAttachmentCreate(AjaxCreateView):
"""
View for adding a new attachment for a StockItem
"""
model = StockItemAttachment
form_class = EditStockItemAttachmentForm
ajax_form_title = _("Add Stock Item Attachment")
ajax_template_name = "modal_form.html"
def get_data(self):
return {
'success': _("Added attachment")
}
def get_initial(self):
"""
Get initial data for the new StockItem attachment object.
- Client must provide a valid StockItem ID
"""
initials = super().get_initial()
try:
initials['stock_item'] = StockItem.objects.get(id=self.request.GET.get('item', None))
except (ValueError, StockItem.DoesNotExist):
pass
return initials
def get_form(self):
form = super().get_form()
form.fields['stock_item'].widget = HiddenInput()
return form
class StockItemAttachmentEdit(AjaxUpdateView):
"""
View for editing a StockItemAttachment object.
"""
model = StockItemAttachment
form_class = EditStockItemAttachmentForm
ajax_form_title = _("Edit Stock Item Attachment")
def get_form(self):
form = super().get_form()
form.fields['stock_item'].widget = HiddenInput()
return form
class StockItemAttachmentDelete(AjaxDeleteView):
"""
View for deleting a StockItemAttachment object.
"""
model = StockItemAttachment
ajax_form_title = _("Delete Stock Item Attachment")
ajax_template_name = "attachment_delete.html"
context_object_name = "attachment"
def get_data(self):
return {
'danger': _("Deleted attachment"),
}
class StockExportOptions(AjaxView):
""" Form for selecting StockExport options """

View File

@ -0,0 +1,7 @@
{% extends "modal_delete_form.html" %}
{% load i18n %}
{% block pre_form_content %}
{% trans "Are you sure you want to delete this attachment?" %}
<br>
{% endblock %}