2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-05-03 22:08:49 +00:00

Merge remote-tracking branch 'inventree/master'

This commit is contained in:
Oliver Walters 2020-05-04 09:39:19 +10:00
commit 1c3878829d
22 changed files with 1364 additions and 1232 deletions

View File

@ -1,6 +1,7 @@
from django.shortcuts import HttpResponseRedirect from django.shortcuts import HttpResponseRedirect
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.db import connection from django.db import connection
from django.shortcuts import redirect
import logging import logging
import time import time
import operator import operator
@ -55,7 +56,7 @@ class AuthRequiredMiddleware(object):
# Does the provided token match a valid user? # Does the provided token match a valid user?
if Token.objects.filter(key=token).exists(): if Token.objects.filter(key=token).exists():
allowed = ['/media/', '/static/'] allowed = ['/api/', '/media/', '/static/']
# Only allow token-auth for /media/ or /static/ dirs! # Only allow token-auth for /media/ or /static/ dirs!
if any([request.path_info.startswith(a) for a in allowed]): if any([request.path_info.startswith(a) for a in allowed]):
@ -63,9 +64,17 @@ class AuthRequiredMiddleware(object):
# No authorization was found for the request # No authorization was found for the request
if not authorized: if not authorized:
if not request.path_info == reverse_lazy('login') and not request.path_info.startswith('/api/'): # A logout request will redirect the user to the login screen
if request.path_info == reverse_lazy('logout'):
return HttpResponseRedirect(reverse_lazy('login')) return HttpResponseRedirect(reverse_lazy('login'))
login = reverse_lazy('login')
if not request.path_info == login and not request.path_info.startswith('/api/'):
# Save the 'next' parameter to pass through to the login view
return redirect('%s?next=%s' % (login, request.path))
# Code to be executed for each request/response after # Code to be executed for each request/response after
# the view is called. # the view is called.

View File

@ -54,6 +54,10 @@ class StatusCode:
return codes return codes
@classmethod
def text(cls, key):
return cls.options.get(key, None)
@classmethod @classmethod
def items(cls): def items(cls):
return cls.options.items() return cls.options.items()
@ -150,6 +154,7 @@ class StockStatus(StatusCode):
ATTENTION = 50 # Item requires attention ATTENTION = 50 # Item requires attention
DAMAGED = 55 # Item is damaged DAMAGED = 55 # Item is damaged
DESTROYED = 60 # Item is destroyed DESTROYED = 60 # Item is destroyed
REJECTED = 65 # Item is rejected
LOST = 70 # Item has been lost LOST = 70 # Item has been lost
RETURNED = 85 # Item has been returned from a customer RETURNED = 85 # Item has been returned from a customer
@ -167,6 +172,7 @@ class StockStatus(StatusCode):
DAMAGED: _("Damaged"), DAMAGED: _("Damaged"),
DESTROYED: _("Destroyed"), DESTROYED: _("Destroyed"),
LOST: _("Lost"), LOST: _("Lost"),
REJECTED: _("Rejected"),
RETURNED: _("Returned"), RETURNED: _("Returned"),
SHIPPED: _('Shipped'), SHIPPED: _('Shipped'),
ASSIGNED_TO_BUILD: _("Used for Build"), ASSIGNED_TO_BUILD: _("Used for Build"),
@ -178,6 +184,7 @@ class StockStatus(StatusCode):
ATTENTION: 'yellow', ATTENTION: 'yellow',
DAMAGED: 'red', DAMAGED: 'red',
DESTROYED: 'red', DESTROYED: 'red',
REJECTED: 'red',
SHIPPED: 'green', SHIPPED: 'green',
ASSIGNED_TO_BUILD: 'blue', ASSIGNED_TO_BUILD: 'blue',
ASSIGNED_TO_OTHER_ITEM: 'blue', ASSIGNED_TO_OTHER_ITEM: 'blue',
@ -195,11 +202,21 @@ class StockStatus(StatusCode):
UNAVAILABLE_CODES = [ UNAVAILABLE_CODES = [
DESTROYED, DESTROYED,
LOST, LOST,
REJECTED,
SHIPPED, SHIPPED,
ASSIGNED_TO_BUILD, ASSIGNED_TO_BUILD,
ASSIGNED_TO_OTHER_ITEM, ASSIGNED_TO_OTHER_ITEM,
] ]
# The following codes are available for receiving goods
RECEIVING_CODES = [
OK,
ATTENTION,
DAMAGED,
DESTROYED,
REJECTED
]
class BuildStatus(StatusCode): class BuildStatus(StatusCode):

View File

@ -35,6 +35,7 @@ from rest_framework.documentation import include_docs_urls
from .views import IndexView, SearchView, DatabaseStatsView from .views import IndexView, SearchView, DatabaseStatsView
from .views import SettingsView, EditUserView, SetPasswordView from .views import SettingsView, EditUserView, SetPasswordView
from .views import DynamicJsView
from .api import InfoView, BarcodePluginView, ActionPluginView from .api import InfoView, BarcodePluginView, ActionPluginView
@ -74,6 +75,12 @@ settings_urls = [
] ]
dynamic_javascript_urls = [ dynamic_javascript_urls = [
url(r'^part.js', DynamicJsView.as_view(template_name='js/part.html'), name='part.js'),
url(r'^stock.js', DynamicJsView.as_view(template_name='js/stock.html'), name='stock.js'),
url(r'^build.js', DynamicJsView.as_view(template_name='js/build.html'), name='build.js'),
url(r'^order.js', DynamicJsView.as_view(template_name='js/order.html'), name='order.js'),
url(r'^company.js', DynamicJsView.as_view(template_name='js/company.html'), name='company.js'),
url(r'^bom.js', DynamicJsView.as_view(template_name='js/bom.html'), name='bom.js'),
] ]
urlpatterns = [ urlpatterns = [
@ -95,7 +102,7 @@ urlpatterns = [
url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')), url(r'^auth/', include('rest_framework.urls', namespace='rest_framework')),
url(r'^login/', auth_views.LoginView.as_view(), name='login'), url(r'^login/?', auth_views.LoginView.as_view(), name='login'),
url(r'^logout/', auth_views.LogoutView.as_view(template_name='registration/logout.html'), name='logout'), url(r'^logout/', auth_views.LogoutView.as_view(template_name='registration/logout.html'), name='logout'),
url(r'^settings/', include(settings_urls)), url(r'^settings/', include(settings_urls)),

View File

@ -514,6 +514,17 @@ class SearchView(TemplateView):
return super(TemplateView, self).render_to_response(context) return super(TemplateView, self).render_to_response(context)
class DynamicJsView(TemplateView):
"""
View for returning javacsript files,
which instead of being served dynamically,
are passed through the django translation engine!
"""
template_name = ""
content_type = 'text/javascript'
class SettingsView(TemplateView): class SettingsView(TemplateView):
""" View for configuring User settings """ View for configuring User settings
""" """

File diff suppressed because it is too large Load Diff

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: 2020-05-02 04:54+0000\n" "POT-Creation-Date: 2020-05-03 09:34+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"
@ -78,19 +78,19 @@ msgstr ""
msgid "File comment" msgid "File comment"
msgstr "" msgstr ""
#: InvenTree/settings.py:274 #: InvenTree/settings.py:295
msgid "English" msgid "English"
msgstr "" msgstr ""
#: InvenTree/settings.py:275 #: InvenTree/settings.py:296
msgid "German" msgid "German"
msgstr "" msgstr ""
#: InvenTree/settings.py:276 #: InvenTree/settings.py:297
msgid "French" msgid "French"
msgstr "" msgstr ""
#: InvenTree/settings.py:277 #: InvenTree/settings.py:298
msgid "Polish" msgid "Polish"
msgstr "" msgstr ""
@ -153,7 +153,7 @@ msgstr ""
#: InvenTree/status_codes.py:214 build/templates/build/allocate.html:349 #: InvenTree/status_codes.py:214 build/templates/build/allocate.html:349
#: order/templates/order/sales_order_detail.html:220 #: order/templates/order/sales_order_detail.html:220
#: part/templates/part/part_base.html:114 part/templates/part/tabs.html:21 #: part/templates/part/tabs.html:21 templates/js/build.html:120
msgid "Allocated" msgid "Allocated"
msgstr "" msgstr ""
@ -182,7 +182,7 @@ msgstr ""
msgid "Overage must be an integer value or a percentage" msgid "Overage must be an integer value or a percentage"
msgstr "" msgstr ""
#: InvenTree/views.py:536 #: InvenTree/views.py:547
msgid "Database Statistics" msgid "Database Statistics"
msgstr "" msgstr ""
@ -221,7 +221,9 @@ msgstr ""
#: order/templates/order/order_wizard/select_parts.html:30 #: order/templates/order/order_wizard/select_parts.html:30
#: order/templates/order/purchase_order_detail.html:145 #: order/templates/order/purchase_order_detail.html:145
#: part/templates/part/part_app_base.html:7 #: part/templates/part/part_app_base.html:7
#: part/templates/part/set_category.html:13 #: part/templates/part/set_category.html:13 templates/js/bom.html:135
#: templates/js/build.html:41 templates/js/company.html:109
#: templates/js/part.html:111 templates/js/stock.html:206
msgid "Part" msgid "Part"
msgstr "" msgstr ""
@ -255,7 +257,7 @@ msgstr ""
msgid "Number of parts to build" msgid "Number of parts to build"
msgstr "" msgstr ""
#: build/models.py:112 part/templates/part/part_base.html:131 #: build/models.py:112 part/templates/part/part_base.html:138
msgid "Build Status" msgid "Build Status"
msgstr "" msgstr ""
@ -272,7 +274,7 @@ msgid "Batch code for this build output"
msgstr "" msgstr ""
#: build/models.py:139 build/templates/build/detail.html:55 #: build/models.py:139 build/templates/build/detail.html:55
#: company/templates/company/supplier_part_base.html:57 #: company/templates/company/supplier_part_base.html:60
#: company/templates/company/supplier_part_detail.html:24 #: company/templates/company/supplier_part_detail.html:24
#: part/templates/part/detail.html:67 part/templates/part/part_base.html:85 #: part/templates/part/detail.html:67 part/templates/part/part_base.html:85
#: stock/models.py:371 stock/templates/stock/item_base.html:189 #: stock/models.py:371 stock/templates/stock/item_base.html:189
@ -288,6 +290,7 @@ msgstr ""
#: order/templates/order/purchase_order_detail.html:200 #: order/templates/order/purchase_order_detail.html:200
#: order/templates/order/so_tabs.html:23 part/templates/part/tabs.html:63 #: order/templates/order/so_tabs.html:23 part/templates/part/tabs.html:63
#: stock/models.py:439 stock/templates/stock/tabs.html:17 #: stock/models.py:439 stock/templates/stock/tabs.html:17
#: templates/js/bom.html:229 templates/js/stock.html:290
msgid "Notes" msgid "Notes"
msgstr "" msgstr ""
@ -371,41 +374,47 @@ msgstr ""
#: stock/templates/stock/item_base.html:20 #: stock/templates/stock/item_base.html:20
#: stock/templates/stock/item_base.html:26 #: stock/templates/stock/item_base.html:26
#: stock/templates/stock/item_base.html:154 #: stock/templates/stock/item_base.html:154
#: stock/templates/stock/stock_adjust.html:18 #: stock/templates/stock/stock_adjust.html:18 templates/js/bom.html:172
#: templates/js/build.html:52 templates/js/stock.html:437
msgid "Quantity" msgid "Quantity"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:177 #: build/templates/build/allocate.html:177
#: build/templates/build/auto_allocate.html:20 #: build/templates/build/auto_allocate.html:20
#: stock/templates/stock/item_base.html:134 #: stock/templates/stock/item_base.html:134
#: stock/templates/stock/stock_adjust.html:17 #: stock/templates/stock/stock_adjust.html:17 templates/js/stock.html:277
msgid "Location" msgid "Location"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:201 #: build/templates/build/allocate.html:201
#: order/templates/order/sales_order_detail.html:92 #: order/templates/order/sales_order_detail.html:92 templates/js/build.html:124
msgid "Edit stock allocation" msgid "Edit stock allocation"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:202 #: build/templates/build/allocate.html:202
#: order/templates/order/sales_order_detail.html:93 #: order/templates/order/sales_order_detail.html:93 templates/js/build.html:125
msgid "Delete stock allocation" msgid "Delete stock allocation"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:229 #: build/templates/build/allocate.html:229 templates/js/bom.html:288
msgid "No BOM items found" msgid "No BOM items found"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:328 #: build/templates/build/allocate.html:328
#: company/templates/company/supplier_part_base.html:50 #: company/templates/company/supplier_part_base.html:53
#: company/templates/company/supplier_part_detail.html:27 #: company/templates/company/supplier_part_detail.html:27
#: order/templates/order/purchase_order_detail.html:157 #: order/templates/order/purchase_order_detail.html:157
#: part/templates/part/detail.html:38 part/templates/part/set_category.html:14 #: part/templates/part/detail.html:38 part/templates/part/set_category.html:14
#: templates/js/bom.html:157 templates/js/company.html:60
#: templates/js/order.html:157 templates/js/order.html:230
#: templates/js/part.html:167 templates/js/stock.html:227
#: templates/js/stock.html:418
msgid "Description" msgid "Description"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:333 #: build/templates/build/allocate.html:333
#: order/templates/order/purchase_order_detail.html:170 #: order/templates/order/purchase_order_detail.html:170
#: templates/js/bom.html:164
msgid "Reference" msgid "Reference"
msgstr "" msgstr ""
@ -452,7 +461,8 @@ msgstr ""
#: build/templates/build/build_base.html:8 #: build/templates/build/build_base.html:8
#: build/templates/build/build_base.html:34 #: build/templates/build/build_base.html:34
#: build/templates/build/complete.html:6 #: build/templates/build/complete.html:6
#: stock/templates/stock/item_base.html:168 templates/navbar.html:12 #: stock/templates/stock/item_base.html:168 templates/js/build.html:33
#: templates/navbar.html:12
msgid "Build" msgid "Build"
msgstr "" msgstr ""
@ -470,7 +480,9 @@ msgstr ""
#: build/templates/build/build_base.html:80 #: build/templates/build/build_base.html:80
#: build/templates/build/detail.html:42 #: build/templates/build/detail.html:42
#: stock/templates/stock/item_base.html:221 #: 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" msgid "Status"
msgstr "" msgstr ""
@ -480,7 +492,7 @@ msgstr ""
#: order/templates/order/sales_order_notes.html:10 #: order/templates/order/sales_order_notes.html:10
#: order/templates/order/sales_order_ship.html:25 #: order/templates/order/sales_order_ship.html:25
#: part/templates/part/allocation.html:27 #: part/templates/part/allocation.html:27
#: stock/templates/stock/item_base.html:122 #: stock/templates/stock/item_base.html:122 templates/js/order.html:209
msgid "Sales Order" msgid "Sales Order"
msgstr "" msgstr ""
@ -547,13 +559,13 @@ msgid "Stock can be taken from any available location."
msgstr "" msgstr ""
#: build/templates/build/detail.html:48 #: build/templates/build/detail.html:48
#: stock/templates/stock/item_base.html:161 #: stock/templates/stock/item_base.html:161 templates/js/stock.html:272
msgid "Batch" msgid "Batch"
msgstr "" msgstr ""
#: build/templates/build/detail.html:61 #: build/templates/build/detail.html:61
#: order/templates/order/order_base.html:93 #: order/templates/order/order_base.html:93
#: order/templates/order/sales_order_base.html:92 #: order/templates/order/sales_order_base.html:92 templates/js/build.html:65
msgid "Created" msgid "Created"
msgstr "" msgstr ""
@ -569,7 +581,7 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
#: build/templates/build/detail.html:80 #: build/templates/build/detail.html:80 templates/js/build.html:70
msgid "Completed" msgid "Completed"
msgstr "" msgstr ""
@ -840,7 +852,7 @@ msgid "Part packaging"
msgstr "" msgstr ""
#: company/templates/company/company_base.html:7 #: company/templates/company/company_base.html:7
#: company/templates/company/company_base.html:22 #: company/templates/company/company_base.html:22 templates/js/company.html:38
msgid "Company" msgid "Company"
msgstr "" msgstr ""
@ -849,7 +861,7 @@ msgstr ""
msgid "Company Details" msgid "Company Details"
msgstr "" msgstr ""
#: company/templates/company/company_base.html:48 #: company/templates/company/company_base.html:48 templates/js/company.html:65
msgid "Website" msgid "Website"
msgstr "" msgstr ""
@ -870,22 +882,25 @@ msgid "Contact"
msgstr "" msgstr ""
#: company/templates/company/detail.html:16 #: company/templates/company/detail.html:16
#: company/templates/company/supplier_part_base.html:73 #: company/templates/company/supplier_part_base.html:76
#: company/templates/company/supplier_part_detail.html:30 #: company/templates/company/supplier_part_detail.html:30
#: templates/js/company.html:48 templates/js/company.html:158
msgid "Manufacturer" msgid "Manufacturer"
msgstr "" msgstr ""
#: company/templates/company/detail.html:21 #: company/templates/company/detail.html:21
#: company/templates/company/supplier_part_base.html:63 #: company/templates/company/supplier_part_base.html:66
#: company/templates/company/supplier_part_detail.html:21 order/models.py:111 #: company/templates/company/supplier_part_detail.html:21 order/models.py:111
#: order/templates/order/order_base.html:74 #: order/templates/order/order_base.html:74
#: order/templates/order/order_wizard/select_pos.html:30 #: order/templates/order/order_wizard/select_pos.html:30
#: stock/templates/stock/item_base.html:196 #: stock/templates/stock/item_base.html:196 templates/js/company.html:52
#: templates/js/company.html:134 templates/js/order.html:144
msgid "Supplier" msgid "Supplier"
msgstr "" msgstr ""
#: company/templates/company/detail.html:26 order/models.py:275 #: company/templates/company/detail.html:26 order/models.py:275
#: order/templates/order/sales_order_base.html:73 #: order/templates/order/sales_order_base.html:73 templates/js/company.html:44
#: templates/js/order.html:217
msgid "Customer" msgid "Customer"
msgstr "" msgstr ""
@ -995,39 +1010,45 @@ msgstr ""
#: company/templates/company/supplier_part_base.html:6 #: company/templates/company/supplier_part_base.html:6
#: company/templates/company/supplier_part_base.html:19 stock/models.py:344 #: company/templates/company/supplier_part_base.html:19 stock/models.py:344
#: stock/templates/stock/item_base.html:201 #: stock/templates/stock/item_base.html:201 templates/js/company.html:150
msgid "Supplier Part" msgid "Supplier Part"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:23 #: company/templates/company/supplier_part_base.html:23
msgid "Edit supplier part" #: part/templates/part/orders.html:14
msgid "Order part"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:26 #: company/templates/company/supplier_part_base.html:26
msgid "Edit supplier part"
msgstr ""
#: company/templates/company/supplier_part_base.html:29
msgid "Delete supplier part" msgid "Delete supplier part"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:35 #: company/templates/company/supplier_part_base.html:38
#: company/templates/company/supplier_part_detail.html:11 #: company/templates/company/supplier_part_detail.html:11
msgid "Supplier Part Details" msgid "Supplier Part Details"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:40 #: company/templates/company/supplier_part_base.html:43
#: company/templates/company/supplier_part_detail.html:14 #: company/templates/company/supplier_part_detail.html:14
msgid "Internal Part" msgid "Internal Part"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:67 #: company/templates/company/supplier_part_base.html:70
#: company/templates/company/supplier_part_detail.html:22 #: company/templates/company/supplier_part_detail.html:22
msgid "SKU" msgid "SKU"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:77 #: company/templates/company/supplier_part_base.html:80
#: company/templates/company/supplier_part_detail.html:31 #: company/templates/company/supplier_part_detail.html:31
#: templates/js/company.html:174
msgid "MPN" msgid "MPN"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:84 #: company/templates/company/supplier_part_base.html:87
#: company/templates/company/supplier_part_detail.html:34 #: company/templates/company/supplier_part_detail.html:34
msgid "Note" msgid "Note"
msgstr "" msgstr ""
@ -1057,6 +1078,7 @@ msgid "New Price Break"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_pricing.html:28 #: company/templates/company/supplier_part_pricing.html:28
#: templates/js/bom.html:213
msgid "Price" msgid "Price"
msgstr "" msgstr ""
@ -1086,7 +1108,8 @@ msgstr ""
#: company/templates/company/supplier_part_tabs.html:8 #: company/templates/company/supplier_part_tabs.html:8
#: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17 #: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17
#: stock/templates/stock/location.html:12 templates/navbar.html:11 #: stock/templates/stock/location.html:12 templates/js/part.html:194
#: templates/js/stock.html:235 templates/navbar.html:11
msgid "Stock" msgid "Stock"
msgstr "" msgstr ""
@ -1260,7 +1283,7 @@ msgstr ""
#: order/models.py:427 order/templates/order/order_base.html:9 #: order/models.py:427 order/templates/order/order_base.html:9
#: order/templates/order/order_base.html:23 #: order/templates/order/order_base.html:23
#: stock/templates/stock/item_base.html:175 #: stock/templates/stock/item_base.html:175 templates/js/order.html:136
msgid "Purchase Order" msgid "Purchase Order"
msgstr "" msgstr ""
@ -1315,7 +1338,7 @@ msgstr ""
msgid "Order Status" msgid "Order Status"
msgstr "" msgstr ""
#: order/templates/order/order_base.html:80 #: order/templates/order/order_base.html:80 templates/js/order.html:151
msgid "Supplier Reference" msgid "Supplier Reference"
msgstr "" msgstr ""
@ -1370,7 +1393,8 @@ msgid "Select existing purchase orders, or create new orders."
msgstr "" msgstr ""
#: order/templates/order/order_wizard/select_pos.html:31 #: order/templates/order/order_wizard/select_pos.html:31
#: order/templates/order/po_tabs.html:5 #: order/templates/order/po_tabs.html:5 templates/js/order.html:175
#: templates/js/order.html:253
msgid "Items" msgid "Items"
msgstr "" msgstr ""
@ -1422,8 +1446,8 @@ msgid "Attachments"
msgstr "" msgstr ""
#: order/templates/order/purchase_order_detail.html:16 #: order/templates/order/purchase_order_detail.html:16
#: order/templates/order/sales_order_detail.html:17 order/views.py:1042 #: order/templates/order/sales_order_detail.html:17 order/views.py:1051
#: order/views.py:1156 #: order/views.py:1165
msgid "Add Line Item" msgid "Add Line Item"
msgstr "" msgstr ""
@ -1474,7 +1498,7 @@ msgstr ""
msgid "Sales Order Details" msgid "Sales Order Details"
msgstr "" msgstr ""
#: order/templates/order/sales_order_base.html:79 #: order/templates/order/sales_order_base.html:79 templates/js/order.html:224
msgid "Customer Reference" msgid "Customer Reference"
msgstr "" msgstr ""
@ -1645,39 +1669,39 @@ msgstr ""
msgid "No lines specified" msgid "No lines specified"
msgstr "" msgstr ""
#: order/views.py:1062 #: order/views.py:1071
msgid "Invalid Purchase Order" msgid "Invalid Purchase Order"
msgstr "" msgstr ""
#: order/views.py:1070 #: order/views.py:1079
msgid "Supplier must match for Part and Order" msgid "Supplier must match for Part and Order"
msgstr "" msgstr ""
#: order/views.py:1075 #: order/views.py:1084
msgid "Invalid SupplierPart selection" msgid "Invalid SupplierPart selection"
msgstr "" msgstr ""
#: order/views.py:1207 order/views.py:1225 #: order/views.py:1216 order/views.py:1234
msgid "Edit Line Item" msgid "Edit Line Item"
msgstr "" msgstr ""
#: order/views.py:1241 order/views.py:1253 #: order/views.py:1250 order/views.py:1262
msgid "Delete Line Item" msgid "Delete Line Item"
msgstr "" msgstr ""
#: order/views.py:1246 order/views.py:1258 #: order/views.py:1255 order/views.py:1267
msgid "Deleted line item" msgid "Deleted line item"
msgstr "" msgstr ""
#: order/views.py:1267 #: order/views.py:1276
msgid "Allocate Stock to Order" msgid "Allocate Stock to Order"
msgstr "" msgstr ""
#: order/views.py:1336 #: order/views.py:1345
msgid "Edit Allocation Quantity" msgid "Edit Allocation Quantity"
msgstr "" msgstr ""
#: order/views.py:1351 #: order/views.py:1360
msgid "Remove allocation" msgid "Remove allocation"
msgstr "" msgstr ""
@ -1923,7 +1947,8 @@ msgstr ""
#: stock/templates/stock/item_base.html:8 #: stock/templates/stock/item_base.html:8
#: stock/templates/stock/item_base.html:52 #: stock/templates/stock/item_base.html:52
#: stock/templates/stock/item_base.html:183 #: stock/templates/stock/item_base.html:183
#: stock/templates/stock/stock_adjust.html:16 #: stock/templates/stock/stock_adjust.html:16 templates/js/build.html:106
#: templates/js/stock.html:407
msgid "Stock Item" msgid "Stock Item"
msgstr "" msgstr ""
@ -2022,6 +2047,7 @@ msgid "Variant Of"
msgstr "" msgstr ""
#: part/templates/part/detail.html:57 part/templates/part/set_category.html:15 #: part/templates/part/detail.html:57 part/templates/part/set_category.html:15
#: templates/js/part.html:181
msgid "Category" msgid "Category"
msgstr "" msgstr ""
@ -2037,7 +2063,7 @@ msgstr ""
msgid "Minimum Stock" msgid "Minimum Stock"
msgstr "" msgstr ""
#: part/templates/part/detail.html:101 #: part/templates/part/detail.html:101 templates/js/order.html:243
msgid "Creation Date" msgid "Creation Date"
msgstr "" msgstr ""
@ -2121,10 +2147,6 @@ msgstr ""
msgid "Part Notes" msgid "Part Notes"
msgstr "" msgstr ""
#: part/templates/part/orders.html:14
msgid "Order part"
msgstr ""
#: part/templates/part/orders.html:14 #: part/templates/part/orders.html:14
msgid "Order Part" msgid "Order Part"
msgstr "" msgstr ""
@ -2177,7 +2199,8 @@ msgstr ""
msgid "This part is a variant of" msgid "This part is a variant of"
msgstr "" msgstr ""
#: part/templates/part/part_base.html:30 #: part/templates/part/part_base.html:30 templates/js/company.html:125
#: templates/js/part.html:158
msgid "Inactive" msgid "Inactive"
msgstr "" msgstr ""
@ -2197,15 +2220,23 @@ msgstr ""
msgid "In Stock" msgid "In Stock"
msgstr "" msgstr ""
#: part/templates/part/part_base.html:114
msgid "Allocated to Build Orders"
msgstr ""
#: part/templates/part/part_base.html:121 #: part/templates/part/part_base.html:121
msgid "Allocated to Sales Orders"
msgstr ""
#: part/templates/part/part_base.html:128 templates/js/part.html:210
msgid "On Order" msgid "On Order"
msgstr "" msgstr ""
#: part/templates/part/part_base.html:136 #: part/templates/part/part_base.html:143
msgid "Can Build" msgid "Can Build"
msgstr "" msgstr ""
#: part/templates/part/part_base.html:142 #: part/templates/part/part_base.html:149
msgid "Underway" msgid "Underway"
msgstr "" msgstr ""
@ -2241,7 +2272,8 @@ msgstr ""
msgid "Create New Part" msgid "Create New Part"
msgstr "" msgstr ""
#: part/templates/part/stock_count.html:7 #: part/templates/part/stock_count.html:7 templates/js/bom.html:203
#: templates/js/part.html:218
msgid "No Stock" msgid "No Stock"
msgstr "" msgstr ""
@ -2949,6 +2981,130 @@ msgstr ""
msgid "Submit Bug Report" msgid "Submit Bug Report"
msgstr "" msgstr ""
#: templates/js/bom.html:143
msgid "Open subassembly"
msgstr ""
#: templates/js/bom.html:194 templates/js/build.html:113
msgid "Available"
msgstr ""
#: templates/js/bom.html:219
msgid "No pricing available"
msgstr ""
#: templates/js/bom.html:239
msgid "Validate BOM Item"
msgstr ""
#: templates/js/bom.html:240
msgid "This line has been validated"
msgstr ""
#: templates/js/bom.html:242
msgid "Edit BOM Item"
msgstr ""
#: templates/js/bom.html:243
msgid "Delete BOM Item"
msgstr ""
#: templates/js/build.html:19
msgid "No builds matching query"
msgstr ""
#: templates/js/build.html:102
msgid "No parts allocated for"
msgstr ""
#: templates/js/company.html:29
msgid "No company information found"
msgstr ""
#: templates/js/company.html:101
msgid "No supplier parts found"
msgstr ""
#: templates/js/company.html:117 templates/js/part.html:136
msgid "Template part"
msgstr ""
#: templates/js/company.html:121 templates/js/part.html:140
msgid "Assembled part"
msgstr ""
#: templates/js/company.html:178
msgid "Link"
msgstr ""
#: templates/js/order.html:126
msgid "No purchase orders found"
msgstr ""
#: templates/js/order.html:170 templates/js/stock.html:389
msgid "Date"
msgstr ""
#: templates/js/order.html:199
msgid "No sales orders found"
msgstr ""
#: templates/js/order.html:248
msgid "Shipment Date"
msgstr ""
#: templates/js/part.html:104 templates/js/stock.html:196
msgid "Select"
msgstr ""
#: templates/js/part.html:144
msgid "Starred part"
msgstr ""
#: templates/js/part.html:148
msgid "Salable part"
msgstr ""
#: templates/js/part.html:187
msgid "No category"
msgstr ""
#: templates/js/part.html:205 templates/table_filters.html:95
msgid "Low stock"
msgstr ""
#: templates/js/part.html:214
msgid "Building"
msgstr ""
#: templates/js/part.html:232
msgid "No parts found"
msgstr ""
#: templates/js/stock.html:66
msgid "No stock items matching query"
msgstr ""
#: templates/js/stock.html:251
msgid "StockItem has been allocated"
msgstr ""
#: templates/js/stock.html:256
msgid "StockItem is lost"
msgstr ""
#: templates/js/stock.html:284
msgid "No stock location set"
msgstr ""
#: templates/js/stock.html:446
msgid "User"
msgstr ""
#: templates/js/stock.html:455
msgid "No user information"
msgstr ""
#: templates/navbar.html:14 #: templates/navbar.html:14
msgid "Buy" msgid "Buy"
msgstr "" msgstr ""
@ -3069,10 +3225,6 @@ msgstr ""
msgid "Stock available" msgid "Stock available"
msgstr "" msgstr ""
#: templates/table_filters.html:95
msgid "Low stock"
msgstr ""
#: templates/table_filters.html:107 #: templates/table_filters.html:107
msgid "Starred" msgid "Starred"
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: 2020-05-02 04:54+0000\n" "POT-Creation-Date: 2020-05-03 09:34+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"
@ -78,19 +78,19 @@ msgstr ""
msgid "File comment" msgid "File comment"
msgstr "" msgstr ""
#: InvenTree/settings.py:274 #: InvenTree/settings.py:295
msgid "English" msgid "English"
msgstr "" msgstr ""
#: InvenTree/settings.py:275 #: InvenTree/settings.py:296
msgid "German" msgid "German"
msgstr "" msgstr ""
#: InvenTree/settings.py:276 #: InvenTree/settings.py:297
msgid "French" msgid "French"
msgstr "" msgstr ""
#: InvenTree/settings.py:277 #: InvenTree/settings.py:298
msgid "Polish" msgid "Polish"
msgstr "" msgstr ""
@ -153,7 +153,7 @@ msgstr ""
#: InvenTree/status_codes.py:214 build/templates/build/allocate.html:349 #: InvenTree/status_codes.py:214 build/templates/build/allocate.html:349
#: order/templates/order/sales_order_detail.html:220 #: order/templates/order/sales_order_detail.html:220
#: part/templates/part/part_base.html:114 part/templates/part/tabs.html:21 #: part/templates/part/tabs.html:21 templates/js/build.html:120
msgid "Allocated" msgid "Allocated"
msgstr "" msgstr ""
@ -182,7 +182,7 @@ msgstr ""
msgid "Overage must be an integer value or a percentage" msgid "Overage must be an integer value or a percentage"
msgstr "" msgstr ""
#: InvenTree/views.py:536 #: InvenTree/views.py:547
msgid "Database Statistics" msgid "Database Statistics"
msgstr "" msgstr ""
@ -221,7 +221,9 @@ msgstr ""
#: order/templates/order/order_wizard/select_parts.html:30 #: order/templates/order/order_wizard/select_parts.html:30
#: order/templates/order/purchase_order_detail.html:145 #: order/templates/order/purchase_order_detail.html:145
#: part/templates/part/part_app_base.html:7 #: part/templates/part/part_app_base.html:7
#: part/templates/part/set_category.html:13 #: part/templates/part/set_category.html:13 templates/js/bom.html:135
#: templates/js/build.html:41 templates/js/company.html:109
#: templates/js/part.html:111 templates/js/stock.html:206
msgid "Part" msgid "Part"
msgstr "" msgstr ""
@ -255,7 +257,7 @@ msgstr ""
msgid "Number of parts to build" msgid "Number of parts to build"
msgstr "" msgstr ""
#: build/models.py:112 part/templates/part/part_base.html:131 #: build/models.py:112 part/templates/part/part_base.html:138
msgid "Build Status" msgid "Build Status"
msgstr "" msgstr ""
@ -272,7 +274,7 @@ msgid "Batch code for this build output"
msgstr "" msgstr ""
#: build/models.py:139 build/templates/build/detail.html:55 #: build/models.py:139 build/templates/build/detail.html:55
#: company/templates/company/supplier_part_base.html:57 #: company/templates/company/supplier_part_base.html:60
#: company/templates/company/supplier_part_detail.html:24 #: company/templates/company/supplier_part_detail.html:24
#: part/templates/part/detail.html:67 part/templates/part/part_base.html:85 #: part/templates/part/detail.html:67 part/templates/part/part_base.html:85
#: stock/models.py:371 stock/templates/stock/item_base.html:189 #: stock/models.py:371 stock/templates/stock/item_base.html:189
@ -288,6 +290,7 @@ msgstr ""
#: order/templates/order/purchase_order_detail.html:200 #: order/templates/order/purchase_order_detail.html:200
#: order/templates/order/so_tabs.html:23 part/templates/part/tabs.html:63 #: order/templates/order/so_tabs.html:23 part/templates/part/tabs.html:63
#: stock/models.py:439 stock/templates/stock/tabs.html:17 #: stock/models.py:439 stock/templates/stock/tabs.html:17
#: templates/js/bom.html:229 templates/js/stock.html:290
msgid "Notes" msgid "Notes"
msgstr "" msgstr ""
@ -371,41 +374,47 @@ msgstr ""
#: stock/templates/stock/item_base.html:20 #: stock/templates/stock/item_base.html:20
#: stock/templates/stock/item_base.html:26 #: stock/templates/stock/item_base.html:26
#: stock/templates/stock/item_base.html:154 #: stock/templates/stock/item_base.html:154
#: stock/templates/stock/stock_adjust.html:18 #: stock/templates/stock/stock_adjust.html:18 templates/js/bom.html:172
#: templates/js/build.html:52 templates/js/stock.html:437
msgid "Quantity" msgid "Quantity"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:177 #: build/templates/build/allocate.html:177
#: build/templates/build/auto_allocate.html:20 #: build/templates/build/auto_allocate.html:20
#: stock/templates/stock/item_base.html:134 #: stock/templates/stock/item_base.html:134
#: stock/templates/stock/stock_adjust.html:17 #: stock/templates/stock/stock_adjust.html:17 templates/js/stock.html:277
msgid "Location" msgid "Location"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:201 #: build/templates/build/allocate.html:201
#: order/templates/order/sales_order_detail.html:92 #: order/templates/order/sales_order_detail.html:92 templates/js/build.html:124
msgid "Edit stock allocation" msgid "Edit stock allocation"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:202 #: build/templates/build/allocate.html:202
#: order/templates/order/sales_order_detail.html:93 #: order/templates/order/sales_order_detail.html:93 templates/js/build.html:125
msgid "Delete stock allocation" msgid "Delete stock allocation"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:229 #: build/templates/build/allocate.html:229 templates/js/bom.html:288
msgid "No BOM items found" msgid "No BOM items found"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:328 #: build/templates/build/allocate.html:328
#: company/templates/company/supplier_part_base.html:50 #: company/templates/company/supplier_part_base.html:53
#: company/templates/company/supplier_part_detail.html:27 #: company/templates/company/supplier_part_detail.html:27
#: order/templates/order/purchase_order_detail.html:157 #: order/templates/order/purchase_order_detail.html:157
#: part/templates/part/detail.html:38 part/templates/part/set_category.html:14 #: part/templates/part/detail.html:38 part/templates/part/set_category.html:14
#: templates/js/bom.html:157 templates/js/company.html:60
#: templates/js/order.html:157 templates/js/order.html:230
#: templates/js/part.html:167 templates/js/stock.html:227
#: templates/js/stock.html:418
msgid "Description" msgid "Description"
msgstr "" msgstr ""
#: build/templates/build/allocate.html:333 #: build/templates/build/allocate.html:333
#: order/templates/order/purchase_order_detail.html:170 #: order/templates/order/purchase_order_detail.html:170
#: templates/js/bom.html:164
msgid "Reference" msgid "Reference"
msgstr "" msgstr ""
@ -452,7 +461,8 @@ msgstr ""
#: build/templates/build/build_base.html:8 #: build/templates/build/build_base.html:8
#: build/templates/build/build_base.html:34 #: build/templates/build/build_base.html:34
#: build/templates/build/complete.html:6 #: build/templates/build/complete.html:6
#: stock/templates/stock/item_base.html:168 templates/navbar.html:12 #: stock/templates/stock/item_base.html:168 templates/js/build.html:33
#: templates/navbar.html:12
msgid "Build" msgid "Build"
msgstr "" msgstr ""
@ -470,7 +480,9 @@ msgstr ""
#: build/templates/build/build_base.html:80 #: build/templates/build/build_base.html:80
#: build/templates/build/detail.html:42 #: build/templates/build/detail.html:42
#: stock/templates/stock/item_base.html:221 #: 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" msgid "Status"
msgstr "" msgstr ""
@ -480,7 +492,7 @@ msgstr ""
#: order/templates/order/sales_order_notes.html:10 #: order/templates/order/sales_order_notes.html:10
#: order/templates/order/sales_order_ship.html:25 #: order/templates/order/sales_order_ship.html:25
#: part/templates/part/allocation.html:27 #: part/templates/part/allocation.html:27
#: stock/templates/stock/item_base.html:122 #: stock/templates/stock/item_base.html:122 templates/js/order.html:209
msgid "Sales Order" msgid "Sales Order"
msgstr "" msgstr ""
@ -547,13 +559,13 @@ msgid "Stock can be taken from any available location."
msgstr "" msgstr ""
#: build/templates/build/detail.html:48 #: build/templates/build/detail.html:48
#: stock/templates/stock/item_base.html:161 #: stock/templates/stock/item_base.html:161 templates/js/stock.html:272
msgid "Batch" msgid "Batch"
msgstr "" msgstr ""
#: build/templates/build/detail.html:61 #: build/templates/build/detail.html:61
#: order/templates/order/order_base.html:93 #: order/templates/order/order_base.html:93
#: order/templates/order/sales_order_base.html:92 #: order/templates/order/sales_order_base.html:92 templates/js/build.html:65
msgid "Created" msgid "Created"
msgstr "" msgstr ""
@ -569,7 +581,7 @@ msgstr ""
msgid "No" msgid "No"
msgstr "" msgstr ""
#: build/templates/build/detail.html:80 #: build/templates/build/detail.html:80 templates/js/build.html:70
msgid "Completed" msgid "Completed"
msgstr "" msgstr ""
@ -840,7 +852,7 @@ msgid "Part packaging"
msgstr "" msgstr ""
#: company/templates/company/company_base.html:7 #: company/templates/company/company_base.html:7
#: company/templates/company/company_base.html:22 #: company/templates/company/company_base.html:22 templates/js/company.html:38
msgid "Company" msgid "Company"
msgstr "" msgstr ""
@ -849,7 +861,7 @@ msgstr ""
msgid "Company Details" msgid "Company Details"
msgstr "" msgstr ""
#: company/templates/company/company_base.html:48 #: company/templates/company/company_base.html:48 templates/js/company.html:65
msgid "Website" msgid "Website"
msgstr "" msgstr ""
@ -870,22 +882,25 @@ msgid "Contact"
msgstr "" msgstr ""
#: company/templates/company/detail.html:16 #: company/templates/company/detail.html:16
#: company/templates/company/supplier_part_base.html:73 #: company/templates/company/supplier_part_base.html:76
#: company/templates/company/supplier_part_detail.html:30 #: company/templates/company/supplier_part_detail.html:30
#: templates/js/company.html:48 templates/js/company.html:158
msgid "Manufacturer" msgid "Manufacturer"
msgstr "" msgstr ""
#: company/templates/company/detail.html:21 #: company/templates/company/detail.html:21
#: company/templates/company/supplier_part_base.html:63 #: company/templates/company/supplier_part_base.html:66
#: company/templates/company/supplier_part_detail.html:21 order/models.py:111 #: company/templates/company/supplier_part_detail.html:21 order/models.py:111
#: order/templates/order/order_base.html:74 #: order/templates/order/order_base.html:74
#: order/templates/order/order_wizard/select_pos.html:30 #: order/templates/order/order_wizard/select_pos.html:30
#: stock/templates/stock/item_base.html:196 #: stock/templates/stock/item_base.html:196 templates/js/company.html:52
#: templates/js/company.html:134 templates/js/order.html:144
msgid "Supplier" msgid "Supplier"
msgstr "" msgstr ""
#: company/templates/company/detail.html:26 order/models.py:275 #: company/templates/company/detail.html:26 order/models.py:275
#: order/templates/order/sales_order_base.html:73 #: order/templates/order/sales_order_base.html:73 templates/js/company.html:44
#: templates/js/order.html:217
msgid "Customer" msgid "Customer"
msgstr "" msgstr ""
@ -995,39 +1010,45 @@ msgstr ""
#: company/templates/company/supplier_part_base.html:6 #: company/templates/company/supplier_part_base.html:6
#: company/templates/company/supplier_part_base.html:19 stock/models.py:344 #: company/templates/company/supplier_part_base.html:19 stock/models.py:344
#: stock/templates/stock/item_base.html:201 #: stock/templates/stock/item_base.html:201 templates/js/company.html:150
msgid "Supplier Part" msgid "Supplier Part"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:23 #: company/templates/company/supplier_part_base.html:23
msgid "Edit supplier part" #: part/templates/part/orders.html:14
msgid "Order part"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:26 #: company/templates/company/supplier_part_base.html:26
msgid "Edit supplier part"
msgstr ""
#: company/templates/company/supplier_part_base.html:29
msgid "Delete supplier part" msgid "Delete supplier part"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:35 #: company/templates/company/supplier_part_base.html:38
#: company/templates/company/supplier_part_detail.html:11 #: company/templates/company/supplier_part_detail.html:11
msgid "Supplier Part Details" msgid "Supplier Part Details"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:40 #: company/templates/company/supplier_part_base.html:43
#: company/templates/company/supplier_part_detail.html:14 #: company/templates/company/supplier_part_detail.html:14
msgid "Internal Part" msgid "Internal Part"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:67 #: company/templates/company/supplier_part_base.html:70
#: company/templates/company/supplier_part_detail.html:22 #: company/templates/company/supplier_part_detail.html:22
msgid "SKU" msgid "SKU"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:77 #: company/templates/company/supplier_part_base.html:80
#: company/templates/company/supplier_part_detail.html:31 #: company/templates/company/supplier_part_detail.html:31
#: templates/js/company.html:174
msgid "MPN" msgid "MPN"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_base.html:84 #: company/templates/company/supplier_part_base.html:87
#: company/templates/company/supplier_part_detail.html:34 #: company/templates/company/supplier_part_detail.html:34
msgid "Note" msgid "Note"
msgstr "" msgstr ""
@ -1057,6 +1078,7 @@ msgid "New Price Break"
msgstr "" msgstr ""
#: company/templates/company/supplier_part_pricing.html:28 #: company/templates/company/supplier_part_pricing.html:28
#: templates/js/bom.html:213
msgid "Price" msgid "Price"
msgstr "" msgstr ""
@ -1086,7 +1108,8 @@ msgstr ""
#: company/templates/company/supplier_part_tabs.html:8 #: company/templates/company/supplier_part_tabs.html:8
#: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17 #: company/templates/company/tabs.html:12 part/templates/part/tabs.html:17
#: stock/templates/stock/location.html:12 templates/navbar.html:11 #: stock/templates/stock/location.html:12 templates/js/part.html:194
#: templates/js/stock.html:235 templates/navbar.html:11
msgid "Stock" msgid "Stock"
msgstr "" msgstr ""
@ -1260,7 +1283,7 @@ msgstr ""
#: order/models.py:427 order/templates/order/order_base.html:9 #: order/models.py:427 order/templates/order/order_base.html:9
#: order/templates/order/order_base.html:23 #: order/templates/order/order_base.html:23
#: stock/templates/stock/item_base.html:175 #: stock/templates/stock/item_base.html:175 templates/js/order.html:136
msgid "Purchase Order" msgid "Purchase Order"
msgstr "" msgstr ""
@ -1315,7 +1338,7 @@ msgstr ""
msgid "Order Status" msgid "Order Status"
msgstr "" msgstr ""
#: order/templates/order/order_base.html:80 #: order/templates/order/order_base.html:80 templates/js/order.html:151
msgid "Supplier Reference" msgid "Supplier Reference"
msgstr "" msgstr ""
@ -1370,7 +1393,8 @@ msgid "Select existing purchase orders, or create new orders."
msgstr "" msgstr ""
#: order/templates/order/order_wizard/select_pos.html:31 #: order/templates/order/order_wizard/select_pos.html:31
#: order/templates/order/po_tabs.html:5 #: order/templates/order/po_tabs.html:5 templates/js/order.html:175
#: templates/js/order.html:253
msgid "Items" msgid "Items"
msgstr "" msgstr ""
@ -1422,8 +1446,8 @@ msgid "Attachments"
msgstr "" msgstr ""
#: order/templates/order/purchase_order_detail.html:16 #: order/templates/order/purchase_order_detail.html:16
#: order/templates/order/sales_order_detail.html:17 order/views.py:1042 #: order/templates/order/sales_order_detail.html:17 order/views.py:1051
#: order/views.py:1156 #: order/views.py:1165
msgid "Add Line Item" msgid "Add Line Item"
msgstr "" msgstr ""
@ -1474,7 +1498,7 @@ msgstr ""
msgid "Sales Order Details" msgid "Sales Order Details"
msgstr "" msgstr ""
#: order/templates/order/sales_order_base.html:79 #: order/templates/order/sales_order_base.html:79 templates/js/order.html:224
msgid "Customer Reference" msgid "Customer Reference"
msgstr "" msgstr ""
@ -1645,39 +1669,39 @@ msgstr ""
msgid "No lines specified" msgid "No lines specified"
msgstr "" msgstr ""
#: order/views.py:1062 #: order/views.py:1071
msgid "Invalid Purchase Order" msgid "Invalid Purchase Order"
msgstr "" msgstr ""
#: order/views.py:1070 #: order/views.py:1079
msgid "Supplier must match for Part and Order" msgid "Supplier must match for Part and Order"
msgstr "" msgstr ""
#: order/views.py:1075 #: order/views.py:1084
msgid "Invalid SupplierPart selection" msgid "Invalid SupplierPart selection"
msgstr "" msgstr ""
#: order/views.py:1207 order/views.py:1225 #: order/views.py:1216 order/views.py:1234
msgid "Edit Line Item" msgid "Edit Line Item"
msgstr "" msgstr ""
#: order/views.py:1241 order/views.py:1253 #: order/views.py:1250 order/views.py:1262
msgid "Delete Line Item" msgid "Delete Line Item"
msgstr "" msgstr ""
#: order/views.py:1246 order/views.py:1258 #: order/views.py:1255 order/views.py:1267
msgid "Deleted line item" msgid "Deleted line item"
msgstr "" msgstr ""
#: order/views.py:1267 #: order/views.py:1276
msgid "Allocate Stock to Order" msgid "Allocate Stock to Order"
msgstr "" msgstr ""
#: order/views.py:1336 #: order/views.py:1345
msgid "Edit Allocation Quantity" msgid "Edit Allocation Quantity"
msgstr "" msgstr ""
#: order/views.py:1351 #: order/views.py:1360
msgid "Remove allocation" msgid "Remove allocation"
msgstr "" msgstr ""
@ -1923,7 +1947,8 @@ msgstr ""
#: stock/templates/stock/item_base.html:8 #: stock/templates/stock/item_base.html:8
#: stock/templates/stock/item_base.html:52 #: stock/templates/stock/item_base.html:52
#: stock/templates/stock/item_base.html:183 #: stock/templates/stock/item_base.html:183
#: stock/templates/stock/stock_adjust.html:16 #: stock/templates/stock/stock_adjust.html:16 templates/js/build.html:106
#: templates/js/stock.html:407
msgid "Stock Item" msgid "Stock Item"
msgstr "" msgstr ""
@ -2022,6 +2047,7 @@ msgid "Variant Of"
msgstr "" msgstr ""
#: part/templates/part/detail.html:57 part/templates/part/set_category.html:15 #: part/templates/part/detail.html:57 part/templates/part/set_category.html:15
#: templates/js/part.html:181
msgid "Category" msgid "Category"
msgstr "" msgstr ""
@ -2037,7 +2063,7 @@ msgstr ""
msgid "Minimum Stock" msgid "Minimum Stock"
msgstr "" msgstr ""
#: part/templates/part/detail.html:101 #: part/templates/part/detail.html:101 templates/js/order.html:243
msgid "Creation Date" msgid "Creation Date"
msgstr "" msgstr ""
@ -2121,10 +2147,6 @@ msgstr ""
msgid "Part Notes" msgid "Part Notes"
msgstr "" msgstr ""
#: part/templates/part/orders.html:14
msgid "Order part"
msgstr ""
#: part/templates/part/orders.html:14 #: part/templates/part/orders.html:14
msgid "Order Part" msgid "Order Part"
msgstr "" msgstr ""
@ -2177,7 +2199,8 @@ msgstr ""
msgid "This part is a variant of" msgid "This part is a variant of"
msgstr "" msgstr ""
#: part/templates/part/part_base.html:30 #: part/templates/part/part_base.html:30 templates/js/company.html:125
#: templates/js/part.html:158
msgid "Inactive" msgid "Inactive"
msgstr "" msgstr ""
@ -2197,15 +2220,23 @@ msgstr ""
msgid "In Stock" msgid "In Stock"
msgstr "" msgstr ""
#: part/templates/part/part_base.html:114
msgid "Allocated to Build Orders"
msgstr ""
#: part/templates/part/part_base.html:121 #: part/templates/part/part_base.html:121
msgid "Allocated to Sales Orders"
msgstr ""
#: part/templates/part/part_base.html:128 templates/js/part.html:210
msgid "On Order" msgid "On Order"
msgstr "" msgstr ""
#: part/templates/part/part_base.html:136 #: part/templates/part/part_base.html:143
msgid "Can Build" msgid "Can Build"
msgstr "" msgstr ""
#: part/templates/part/part_base.html:142 #: part/templates/part/part_base.html:149
msgid "Underway" msgid "Underway"
msgstr "" msgstr ""
@ -2241,7 +2272,8 @@ msgstr ""
msgid "Create New Part" msgid "Create New Part"
msgstr "" msgstr ""
#: part/templates/part/stock_count.html:7 #: part/templates/part/stock_count.html:7 templates/js/bom.html:203
#: templates/js/part.html:218
msgid "No Stock" msgid "No Stock"
msgstr "" msgstr ""
@ -2949,6 +2981,130 @@ msgstr ""
msgid "Submit Bug Report" msgid "Submit Bug Report"
msgstr "" msgstr ""
#: templates/js/bom.html:143
msgid "Open subassembly"
msgstr ""
#: templates/js/bom.html:194 templates/js/build.html:113
msgid "Available"
msgstr ""
#: templates/js/bom.html:219
msgid "No pricing available"
msgstr ""
#: templates/js/bom.html:239
msgid "Validate BOM Item"
msgstr ""
#: templates/js/bom.html:240
msgid "This line has been validated"
msgstr ""
#: templates/js/bom.html:242
msgid "Edit BOM Item"
msgstr ""
#: templates/js/bom.html:243
msgid "Delete BOM Item"
msgstr ""
#: templates/js/build.html:19
msgid "No builds matching query"
msgstr ""
#: templates/js/build.html:102
msgid "No parts allocated for"
msgstr ""
#: templates/js/company.html:29
msgid "No company information found"
msgstr ""
#: templates/js/company.html:101
msgid "No supplier parts found"
msgstr ""
#: templates/js/company.html:117 templates/js/part.html:136
msgid "Template part"
msgstr ""
#: templates/js/company.html:121 templates/js/part.html:140
msgid "Assembled part"
msgstr ""
#: templates/js/company.html:178
msgid "Link"
msgstr ""
#: templates/js/order.html:126
msgid "No purchase orders found"
msgstr ""
#: templates/js/order.html:170 templates/js/stock.html:389
msgid "Date"
msgstr ""
#: templates/js/order.html:199
msgid "No sales orders found"
msgstr ""
#: templates/js/order.html:248
msgid "Shipment Date"
msgstr ""
#: templates/js/part.html:104 templates/js/stock.html:196
msgid "Select"
msgstr ""
#: templates/js/part.html:144
msgid "Starred part"
msgstr ""
#: templates/js/part.html:148
msgid "Salable part"
msgstr ""
#: templates/js/part.html:187
msgid "No category"
msgstr ""
#: templates/js/part.html:205 templates/table_filters.html:95
msgid "Low stock"
msgstr ""
#: templates/js/part.html:214
msgid "Building"
msgstr ""
#: templates/js/part.html:232
msgid "No parts found"
msgstr ""
#: templates/js/stock.html:66
msgid "No stock items matching query"
msgstr ""
#: templates/js/stock.html:251
msgid "StockItem has been allocated"
msgstr ""
#: templates/js/stock.html:256
msgid "StockItem is lost"
msgstr ""
#: templates/js/stock.html:284
msgid "No stock location set"
msgstr ""
#: templates/js/stock.html:446
msgid "User"
msgstr ""
#: templates/js/stock.html:455
msgid "No user information"
msgstr ""
#: templates/navbar.html:14 #: templates/navbar.html:14
msgid "Buy" msgid "Buy"
msgstr "" msgstr ""
@ -3069,10 +3225,6 @@ msgstr ""
msgid "Stock available" msgid "Stock available"
msgstr "" msgstr ""
#: templates/table_filters.html:95
msgid "Low stock"
msgstr ""
#: templates/table_filters.html:107 #: templates/table_filters.html:107
msgid "Starred" msgid "Starred"
msgstr "" msgstr ""

View File

@ -209,7 +209,7 @@ class PurchaseOrder(Order):
return self.pending_line_items().count() == 0 return self.pending_line_items().count() == 0
@transaction.atomic @transaction.atomic
def receive_line_item(self, line, location, quantity, user): def receive_line_item(self, line, location, quantity, user, status=StockStatus.OK):
""" Receive a line item (or partial line item) against this PO """ Receive a line item (or partial line item) against this PO
""" """
@ -230,7 +230,9 @@ class PurchaseOrder(Order):
supplier_part=line.part, supplier_part=line.part,
location=location, location=location,
quantity=quantity, quantity=quantity,
purchase_order=self) purchase_order=self,
status=status
)
stock.save() stock.save()

View File

@ -145,7 +145,7 @@ $("#po-table").inventreeTable({
title: '{% trans "Part" %}', title: '{% trans "Part" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (row.part) { if (row.part) {
return imageHoverIcon(row.part_detail.thumbnail) + renderLink(row.part_detail.full_name, `/part/${value}/`); return imageHoverIcon(row.part_detail.thumbnail) + renderLink(row.part_detail.full_name, `/part/${row.part_detail.pk}/`);
} else { } else {
return '-'; return '-';
} }

View File

@ -1,23 +1,28 @@
{% extends "modal_form.html" %} {% extends "modal_form.html" %}
{% load i18n %}
{% load inventree_extras %}
{% load status_codes %}
{% block form %} {% block form %}
Receive outstanding parts for <b>{{ order }}</b> - <i>{{ order.description }}</i> {% trans "Receive outstanding parts for" %} <b>{{ order }}</b> - <i>{{ order.description }}</i>
<form method='post' action='' class='js-modal-form' enctype='multipart/form-data'> <form method='post' action='' class='js-modal-form' enctype='multipart/form-data'>
{% csrf_token %} {% csrf_token %}
{% load crispy_forms_tags %} {% load crispy_forms_tags %}
<label class='control-label'>Parts</label> <label class='control-label'>{% trans "Parts" %}</label>
<p class='help-block'>Select parts to receive against this order.</p> <p class='help-block'>{% trans "Select parts to receive against this order" %}</p>
<table class='table table-striped'> <table class='table table-striped'>
<tr> <tr>
<th>Part</th> <th>{% trans "Part" %}</th>
<th>Order Code</th> <th>{% trans "Order Code" %}</th>
<th>On Order</th> <th>{% trans "On Order" %}</th>
<th>Received</th> <th>{% trans "Received" %}</th>
<th>Receive</th> <th>{% trans "Receive" %}</th>
<th>{% trans "Status" %}</th>
<th></th>
</tr> </tr>
{% for line in lines %} {% for line in lines %}
<tr id='line_row_{{ line.id }}'> <tr id='line_row_{{ line.id }}'>
@ -28,20 +33,29 @@ Receive outstanding parts for <b>{{ order }}</b> - <i>{{ order.description }}</i
</td> </td>
<td>{{ line.part.SKU }}</td> <td>{{ line.part.SKU }}</td>
{% else %} {% else %}
<td colspan='2'>Referenced part has been removed</td> <td colspan='2'>{% trans "Error: Referenced part has been removed" %}</td>
{% endif %} {% endif %}
<td>{{ line.quantity }}</td> <td>{% decimal line.quantity %}</td>
<td>{{ line.received }}</td> <td>{% decimal line.received %}</td>
<td> <td>
<div class='control-group'> <div class='control-group'>
<div class='controls'> <div class='controls'>
<input class='numberinput' type='number' min='0' value='{{ line.receive_quantity }}' name='line-{{ line.id }}'/> <input class='numberinput' type='number' min='0' value='{% decimal line.receive_quantity %}' name='line-{{ line.id }}'/>
</div> </div>
</div> </div>
</td> </td>
<td>
<div class='control-group'>
<select class='select' name='status-{{ line.id }}'>
{% for code in StockStatus.RECEIVING_CODES %}
<option value="{{ code }}" {% if code|add:"0" == line.status_code|add:"0" %}selected="selected"{% endif %}>{% stock_status_text code %}</option>
{% endfor %}
</select>
</div>
</td>
<td> <td>
<button class='btn btn-default btn-remove' onClick="removeOrderRowFromOrderWizard()" id='del_item_{{ line.id }}' title='Remove line' type='button'> <button class='btn btn-default btn-remove' onClick="removeOrderRowFromOrderWizard()" id='del_item_{{ line.id }}' title='Remove line' type='button'>
<span row='line_row_{{ line.id }}' class='fas fa-trash-alt icon-red'></span> <span row='line_row_{{ line.id }}' class='fas fa-times-circle icon-red'></span>
</button> </button>
</td> </td>
</tr> </tr>

View File

@ -29,7 +29,7 @@ from . import forms as order_forms
from InvenTree.views import AjaxView, AjaxCreateView, AjaxUpdateView, AjaxDeleteView from InvenTree.views import AjaxView, AjaxCreateView, AjaxUpdateView, AjaxDeleteView
from InvenTree.helpers import DownloadFile, str2bool from InvenTree.helpers import DownloadFile, str2bool
from InvenTree.status_codes import PurchaseOrderStatus from InvenTree.status_codes import PurchaseOrderStatus, StockStatus
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
@ -669,6 +669,20 @@ class PurchaseOrderReceive(AjaxUpdateView):
except (PurchaseOrderLineItem.DoesNotExist, ValueError): except (PurchaseOrderLineItem.DoesNotExist, ValueError):
continue continue
# Check that the StockStatus was set
status_key = 'status-{pk}'.format(pk=pk)
status = request.POST.get(status_key, StockStatus.OK)
try:
status = int(status)
except ValueError:
status = StockStatus.OK
if status in StockStatus.RECEIVING_CODES:
line.status_code = status
else:
line.status_code = StockStatus.OK
# Check that line matches the order # Check that line matches the order
if not line.order == self.order: if not line.order == self.order:
# TODO - Display a non-field error? # TODO - Display a non-field error?
@ -725,7 +739,13 @@ class PurchaseOrderReceive(AjaxUpdateView):
if not line.part: if not line.part:
continue continue
self.order.receive_line_item(line, self.destination, line.receive_quantity, self.request.user) self.order.receive_line_item(
line,
self.destination,
line.receive_quantity,
self.request.user,
status=line.status_code,
)
class OrderParts(AjaxView): class OrderParts(AjaxView):

View File

@ -28,6 +28,11 @@ def stock_status_label(key, *args, **kwargs):
return mark_safe(StockStatus.render(key, large=kwargs.get('large', False))) return mark_safe(StockStatus.render(key, large=kwargs.get('large', False)))
@register.simple_tag
def stock_status_text(key, *args, **kwargs):
return mark_safe(StockStatus.text(key))
@register.simple_tag @register.simple_tag
def build_status_label(key, *args, **kwargs): def build_status_label(key, *args, **kwargs):
""" Render a Build status label """ """ Render a Build status label """

View File

@ -0,0 +1,111 @@
"""
This script is used to simplify the translation process.
Django provides a framework for working out which strings are "translatable",
and these strings are then dumped in a file under InvenTree/locale/<lang>/LC_MESSAGES/django.po
This script presents the translator with a list of strings which have not yet been translated,
allowing for a simpler and quicker translation process.
If a string translation needs to be updated, this will still need to be done manually,
by editing the appropriate .po file.
"""
import argparse
import os
import sys
def manually_translate_file(filename, save=False):
"""
Manually translate a .po file.
Present any missing translation strings to the translator,
and write their responses back to the file.
"""
print("Add manual translations to '{f}'".format(f=filename))
print("For each missing translation:")
print("a) Directly enter a new tranlation in the target language")
print("b) Leave empty to skip")
input("Press <ENTER> to continue")
print("")
with open(filename, 'r') as f:
lines = f.readlines()
out = []
# Context data
source_line = ''
msgid = ''
for num, line in enumerate(lines):
# Keep track of context data BEFORE an empty msgstr object
line = line.strip()
if line.startswith("#: "):
source_line = line.replace("#: ", "")
elif line.startswith("msgid "):
msgid = line.replace("msgid ", "")
if line.strip() == 'msgstr ""':
# We have found an empty translation!
if msgid and len(msgid) > 0 and not msgid == '""':
print("Source:", source_line)
print("Enter translation for {t}".format(t=msgid))
translation = str(input(">"))
if translation and len(translation) > 0:
# Update the line with the new translation
line = 'msgstr "{msg}"'.format(msg=translation)
out.append(line + "\r\n")
if save:
with open(filename, 'w') as output_file:
output_file.writelines(out)
print("Translation done: written to", filename)
print("Run 'make translate' to rebuild translation data")
if __name__ == '__main__':
MY_DIR = os.path.dirname(os.path.realpath(__file__))
LOCALE_DIR = os.path.join(MY_DIR, '..', 'locale')
if not os.path.exists(LOCALE_DIR):
print("Error: {d} does not exist!".format(d=LOCALE_DIR))
sys.exit(1)
parser = argparse.ArgumentParser(description="InvenTree Translation Helper")
parser.add_argument('language', help='Language code', action='store')
parser.add_argument('--fake', help="Do not save updated translations", action='store_true')
args = parser.parse_args()
language = args.language
LANGUAGE_DIR = os.path.abspath(os.path.join(LOCALE_DIR, language))
# Check that a locale directory exists for the given language!
if not os.path.exists(LANGUAGE_DIR):
print("Error: Locale directory for language '{l}' does not exist".format(l=language))
sys.exit(1)
# Check that a .po file exists for the given language!
PO_FILE = os.path.join(LANGUAGE_DIR, 'LC_MESSAGES', 'django.po')
if not os.path.exists(PO_FILE):
print("Error: File '{f}' does not exist".format(f=PO_FILE))
sys.exit(1)
# Ok, now we run the user through the translation file
manually_translate_file(PO_FILE, save=args.fake is not True)

View File

@ -0,0 +1,19 @@
# Generated by Django 3.0.5 on 2020-05-02 23:08
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stock', '0034_auto_20200426_0602'),
]
operations = [
migrations.AlterField(
model_name='stockitem',
name='status',
field=models.PositiveIntegerField(choices=[(10, 'OK'), (50, 'Attention needed'), (55, 'Damaged'), (60, 'Destroyed'), (70, 'Lost'), (65, 'Rejected'), (85, 'Returned'), (110, 'Shipped'), (120, 'Used for Build'), (130, 'Installed in Stock Item')], default=10, validators=[django.core.validators.MinValueValidator(0)]),
),
]

View File

@ -102,18 +102,19 @@ InvenTree
<script type='text/javascript' src="{% static 'script/inventree/inventree.js' %}"></script> <script type='text/javascript' src="{% static 'script/inventree/inventree.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/api.js' %}"></script> <script type='text/javascript' src="{% static 'script/inventree/api.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/part.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/bom.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/filters.js' %}"></script> <script type='text/javascript' src="{% static 'script/inventree/filters.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/tables.js' %}"></script> <script type='text/javascript' src="{% static 'script/inventree/tables.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/build.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/stock.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/modals.js' %}"></script> <script type='text/javascript' src="{% static 'script/inventree/modals.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/order.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/company.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/notification.js' %}"></script> <script type='text/javascript' src="{% static 'script/inventree/notification.js' %}"></script>
<script type='text/javascript' src="{% static 'script/inventree/sidenav.js' %}"></script> <script type='text/javascript' src="{% static 'script/inventree/sidenav.js' %}"></script>
<script type='text/javascript' src="{% url 'bom.js' %}"></script>
<script type='text/javascript' src="{% url 'company.js' %}"></script>
<script type='text/javascript' src="{% url 'part.js' %}"></script>
<script type='text/javascript' src="{% url 'stock.js' %}"></script>
<script type='text/javascript' src="{% url 'build.js' %}"></script>
<script type='text/javascript' src="{% url 'order.js' %}"></script>
<script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script> <script type='text/javascript' src="{% static 'fontawesome/js/solid.js' %}"></script>
<script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script> <script type='text/javascript' src="{% static 'fontawesome/js/brands.js' %}"></script>
<script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script> <script type='text/javascript' src="{% static 'fontawesome/js/fontawesome.js' %}"></script>

View File

@ -1,3 +1,5 @@
{% load i18n %}
/* BOM management functions. /* BOM management functions.
* Requires follwing files to be loaded first: * Requires follwing files to be loaded first:
* - api.js * - api.js
@ -130,7 +132,7 @@ function loadBomTable(table, options) {
cols.push( cols.push(
{ {
field: 'sub_part_detail.full_name', field: 'sub_part_detail.full_name',
title: 'Part', title: '{% trans "Part" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var url = `/part/${row.sub_part}/`; var url = `/part/${row.sub_part}/`;
@ -138,7 +140,7 @@ function loadBomTable(table, options) {
// Display an extra icon if this part is an assembly // Display an extra icon if this part is an assembly
if (row.sub_part_detail.assembly) { if (row.sub_part_detail.assembly) {
var text = `<span title='Open subassembly' class='fas fa-stream label-right'></span>`; var text = `<span title='{% trans "Open subassembly" %}' class='fas fa-stream label-right'></span>`;
html += renderLink(text, `/part/${row.sub_part}/bom/`); html += renderLink(text, `/part/${row.sub_part}/bom/`);
} }
@ -152,14 +154,14 @@ function loadBomTable(table, options) {
cols.push( cols.push(
{ {
field: 'sub_part_detail.description', field: 'sub_part_detail.description',
title: 'Description', title: '{% trans "Description" %}',
} }
); );
// Part reference // Part reference
cols.push({ cols.push({
field: 'reference', field: 'reference',
title: 'Reference', title: '{% trans "Reference" %}',
searchable: true, searchable: true,
sortable: true, sortable: true,
}); });
@ -167,7 +169,7 @@ function loadBomTable(table, options) {
// Part quantity // Part quantity
cols.push({ cols.push({
field: 'quantity', field: 'quantity',
title: 'Quantity', title: '{% trans "Quantity" %}',
searchable: false, searchable: false,
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
@ -189,7 +191,7 @@ function loadBomTable(table, options) {
cols.push( cols.push(
{ {
field: 'sub_part_detail.stock', field: 'sub_part_detail.stock',
title: 'Available', title: '{% trans "Available" %}',
searchable: false, searchable: false,
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
@ -198,7 +200,7 @@ function loadBomTable(table, options) {
var text = value; var text = value;
if (value == null || value <= 0) { if (value == null || value <= 0) {
text = `<span class='label label-warning'>No Stock</span>`; text = `<span class='label label-warning'>{% trans "No Stock" %}</span>`;
} }
return renderLink(text, url); return renderLink(text, url);
@ -208,13 +210,13 @@ function loadBomTable(table, options) {
cols.push( cols.push(
{ {
field: 'price_range', field: 'price_range',
title: 'Price', title: '{% trans "Price" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (value) { if (value) {
return value; return value;
} else { } else {
return "<span class='warning-msg'>No pricing available</span>"; return "<span class='warning-msg'>{% trans "No pricing available" %}</span>";
} }
} }
}); });
@ -224,7 +226,7 @@ function loadBomTable(table, options) {
cols.push( cols.push(
{ {
field: 'note', field: 'note',
title: 'Notes', title: '{% trans "Notes" %}',
searchable: true, searchable: true,
sortable: true, sortable: true,
} }
@ -234,11 +236,11 @@ function loadBomTable(table, options) {
cols.push({ cols.push({
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var bValidate = "<button title='Validate BOM Item' class='bom-validate-button btn btn-default btn-glyph' type='button' pk='" + row.pk + "'><span class='fas fa-check-circle icon-blue'/></button>"; var bValidate = "<button title='{% trans "Validate BOM Item" %}' class='bom-validate-button btn btn-default btn-glyph' type='button' pk='" + row.pk + "'><span class='fas fa-check-circle icon-blue'/></button>";
var bValid = "<span title='This line has been validated' class='fas fa-check-double icon-green'/>"; var bValid = "<span title='{% trans "This line has been validated" %}' class='fas fa-check-double icon-green'/>";
var bEdit = "<button title='Edit BOM Item' class='bom-edit-button btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/edit'><span class='fas fa-edit'/></button>"; var bEdit = "<button title='{% trans "Edit BOM Item" %}' class='bom-edit-button btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/edit'><span class='fas fa-edit'/></button>";
var bDelt = "<button title='Delete BOM Item' class='bom-delete-button btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/delete'><span class='fas fa-trash-alt icon-red'/></button>"; var bDelt = "<button title='{% trans "Delete BOM Item" %}' class='bom-delete-button btn btn-default btn-glyph' type='button' url='/part/bom/" + row.pk + "/delete'><span class='fas fa-trash-alt icon-red'/></button>";
var html = "<div class='btn-group' role='group'>"; var html = "<div class='btn-group' role='group'>";
@ -283,7 +285,7 @@ function loadBomTable(table, options) {
return {classes: 'rowinvalid'}; return {classes: 'rowinvalid'};
} }
}, },
formatNoMatches: function() { return "No BOM items found"; }, formatNoMatches: function() { return "{% trans "No BOM items found" %}"; },
clickToSelect: true, clickToSelect: true,
queryParams: function(p) { queryParams: function(p) {
return params; return params;

View File

@ -1,3 +1,5 @@
{% load i18n %}
function loadBuildTable(table, options) { function loadBuildTable(table, options) {
// Display a table of Build objects // Display a table of Build objects
@ -14,7 +16,7 @@ function loadBuildTable(table, options) {
table.inventreeTable({ table.inventreeTable({
method: 'get', method: 'get',
formatNoMatches: function() { formatNoMatches: function() {
return "No builds matching query"; return "{% trans "No builds matching query" %}";
}, },
url: options.url, url: options.url,
queryParams: filters, queryParams: filters,
@ -28,7 +30,7 @@ function loadBuildTable(table, options) {
}, },
{ {
field: 'title', field: 'title',
title: 'Build', title: '{% trans "Build" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return renderLink(value, '/build/' + row.pk + '/'); return renderLink(value, '/build/' + row.pk + '/');
@ -36,7 +38,7 @@ function loadBuildTable(table, options) {
}, },
{ {
field: 'part', field: 'part',
title: 'Part', title: '{% trans "Part" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
@ -47,12 +49,12 @@ function loadBuildTable(table, options) {
}, },
{ {
field: 'quantity', field: 'quantity',
title: 'Quantity', title: '{% trans "Quantity" %}',
sortable: true, sortable: true,
}, },
{ {
field: 'status', field: 'status',
title: 'Status', title: '{% trans "Status" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return buildStatusDisplay(value); return buildStatusDisplay(value);
@ -60,12 +62,12 @@ function loadBuildTable(table, options) {
}, },
{ {
field: 'creation_date', field: 'creation_date',
title: 'Created', title: '{% trans "Created" %}',
sortable: true, sortable: true,
}, },
{ {
field: 'completion_date', field: 'completion_date',
title: 'Completed', title: '{% trans "Completed" %}',
sortable: true, sortable: true,
}, },
], ],
@ -97,30 +99,30 @@ function loadAllocationTable(table, part_id, part, url, required, button) {
table.bootstrapTable({ table.bootstrapTable({
url: url, url: url,
sortable: false, sortable: false,
formatNoMatches: function() { return 'No parts allocated for ' + part; }, formatNoMatches: function() { return '{% trans "No parts allocated for" %} ' + part; },
columns: [ columns: [
{ {
field: 'stock_item_detail', field: 'stock_item_detail',
title: 'Stock Item', title: '{% trans "Stock Item" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return '' + parseFloat(value.quantity) + ' x ' + value.part_name + ' @ ' + value.location_name; return '' + parseFloat(value.quantity) + ' x ' + value.part_name + ' @ ' + value.location_name;
} }
}, },
{ {
field: 'stock_item_detail.quantity', field: 'stock_item_detail.quantity',
title: 'Available', title: '{% trans "Available" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return parseFloat(value); return parseFloat(value);
} }
}, },
{ {
field: 'quantity', field: 'quantity',
title: 'Allocated', title: '{% trans "Allocated" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var html = parseFloat(value); var html = parseFloat(value);
var bEdit = "<button class='btn item-edit-button btn-sm' type='button' title='Edit stock allocation' url='/build/item/" + row.pk + "/edit/'><span class='fas fa-edit'></span></button>"; var bEdit = "<button class='btn item-edit-button btn-sm' type='button' title='{% trans "Edit stock allocation" %}' url='/build/item/" + row.pk + "/edit/'><span class='fas fa-edit'></span></button>";
var bDel = "<button class='btn item-del-button btn-sm' type='button' title='Delete stock allocation' url='/build/item/" + row.pk + "/delete/'><span class='fas fa-trash-alt icon-red'></span></button>"; var bDel = "<button class='btn item-del-button btn-sm' type='button' title='{% trans "Delete stock allocation" %}' url='/build/item/" + row.pk + "/delete/'><span class='fas fa-trash-alt icon-red'></span></button>";
html += "<div class='btn-group' style='float: right;'>" + bEdit + bDel + "</div>"; html += "<div class='btn-group' style='float: right;'>" + bEdit + bDel + "</div>";

View File

@ -1,3 +1,4 @@
{% load i18n %}
function loadCompanyTable(table, url, options={}) { function loadCompanyTable(table, url, options={}) {
/* /*
@ -25,7 +26,7 @@ function loadCompanyTable(table, url, options={}) {
method: 'get', method: 'get',
queryParams: filters, queryParams: filters,
groupBy: false, groupBy: false,
formatNoMatches: function() { return "No company information found"; }, formatNoMatches: function() { return "{% trans "No company information found" %}"; },
columns: [ columns: [
{ {
field: 'pk', field: 'pk',
@ -34,21 +35,21 @@ function loadCompanyTable(table, url, options={}) {
}, },
{ {
field: 'name', field: 'name',
title: 'Company', title: '{% trans "Company" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var html = imageHoverIcon(row.image) + renderLink(value, row.url); var html = imageHoverIcon(row.image) + renderLink(value, row.url);
if (row.is_customer) { if (row.is_customer) {
html += `<span title='Customer' class='fas fa-user-tie label-right'></span>`; html += `<span title='{% trans "Customer" %}' class='fas fa-user-tie label-right'></span>`;
} }
if (row.is_manufacturer) { if (row.is_manufacturer) {
html += `<span title='Manufacturer' class='fas fa-industry label-right'></span>`; html += `<span title='{% trans "Manufacturer" %}' class='fas fa-industry label-right'></span>`;
} }
if (row.is_supplier) { if (row.is_supplier) {
html += `<span title='Supplier' class='fas fa-building label-right'></span>`; html += `<span title='{% trans "Supplier" %}' class='fas fa-building label-right'></span>`;
} }
return html; return html;
@ -56,12 +57,12 @@ function loadCompanyTable(table, url, options={}) {
}, },
{ {
field: 'description', field: 'description',
title: 'Description', title: '{% trans "Description" %}',
sortable: true, sortable: true,
}, },
{ {
field: 'website', field: 'website',
title: 'Website', title: '{% trans "Website" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (value) { if (value) {
return renderLink(value, value); return renderLink(value, value);
@ -97,7 +98,7 @@ function loadSupplierPartTable(table, url, options) {
method: 'get', method: 'get',
queryParams: filters, queryParams: filters,
groupBy: false, groupBy: false,
formatNoMatches: function() { return "No supplier parts found"; }, formatNoMatches: function() { return "{% trans "No supplier parts found" %}"; },
columns: [ columns: [
{ {
checkbox: true, checkbox: true,
@ -105,7 +106,7 @@ function loadSupplierPartTable(table, url, options) {
{ {
sortable: true, sortable: true,
field: 'part_detail.full_name', field: 'part_detail.full_name',
title: 'Part', title: '{% trans "Part" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var url = `/part/${row.part}/`; var url = `/part/${row.part}/`;
@ -113,15 +114,15 @@ function loadSupplierPartTable(table, url, options) {
var html = imageHoverIcon(row.part_detail.thumbnail) + renderLink(value, url); var html = imageHoverIcon(row.part_detail.thumbnail) + renderLink(value, url);
if (row.part_detail.is_template) { if (row.part_detail.is_template) {
html += `<span class='fas fa-clone label-right' title='Template part'></span>`; html += `<span class='fas fa-clone label-right' title='{% trans "Template part" %}'></span>`;
} }
if (row.part_detail.assembly) { if (row.part_detail.assembly) {
html += `<span class='fas fa-tools label-right' title='Assembled part'></span>`; html += `<span class='fas fa-tools label-right' title='{% trans "Assembled part" %}'></span>`;
} }
if (!row.part_detail.active) { if (!row.part_detail.active) {
html += `<span class='label label-warning label-right'>INACTIVE</span>`; html += `<span class='label label-warning label-right'>{% trans "Inactive" %}</span>`;
} }
return html; return html;
@ -130,7 +131,7 @@ function loadSupplierPartTable(table, url, options) {
{ {
sortable: true, sortable: true,
field: 'supplier', field: 'supplier',
title: "Supplier", title: "{% trans "Supplier" %}",
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (value) { if (value) {
var name = row.supplier_detail.name; var name = row.supplier_detail.name;
@ -146,7 +147,7 @@ function loadSupplierPartTable(table, url, options) {
{ {
sortable: true, sortable: true,
field: 'SKU', field: 'SKU',
title: "Supplier Part", title: "{% trans "Supplier Part" %}",
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return renderLink(value, `/supplier-part/${row.pk}/`); return renderLink(value, `/supplier-part/${row.pk}/`);
} }
@ -154,7 +155,7 @@ function loadSupplierPartTable(table, url, options) {
{ {
sortable: true, sortable: true,
field: 'manufacturer', field: 'manufacturer',
title: 'Manufacturer', title: '{% trans "Manufacturer" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (value) { if (value) {
var name = row.manufacturer_detail.name; var name = row.manufacturer_detail.name;
@ -170,11 +171,11 @@ function loadSupplierPartTable(table, url, options) {
{ {
sortable: true, sortable: true,
field: 'MPN', field: 'MPN',
title: 'MPN', title: '{% trans "MPN" %}',
}, },
{ {
field: 'link', field: 'link',
title: 'Link', title: '{% trans "Link" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (value) { if (value) {
return renderLink(value, value); return renderLink(value, value);

View File

@ -1,3 +1,5 @@
{% load i18n %}
function removeOrderRowFromOrderWizard(e) { function removeOrderRowFromOrderWizard(e) {
/* Remove a part selection from an order form. */ /* Remove a part selection from an order form. */
@ -121,7 +123,7 @@ function loadPurchaseOrderTable(table, options) {
queryParams: filters, queryParams: filters,
groupBy: false, groupBy: false,
original: options.params, original: options.params,
formatNoMatches: function() { return "No purchase orders found"; }, formatNoMatches: function() { return "{% trans "No purchase orders found" %}"; },
columns: [ columns: [
{ {
field: 'pk', field: 'pk',
@ -131,7 +133,7 @@ function loadPurchaseOrderTable(table, options) {
{ {
sortable: true, sortable: true,
field: 'reference', field: 'reference',
title: 'Purchase Order', title: '{% trans "Purchase Order" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return renderLink(value, `/order/purchase-order/${row.pk}/`); return renderLink(value, `/order/purchase-order/${row.pk}/`);
} }
@ -139,25 +141,25 @@ function loadPurchaseOrderTable(table, options) {
{ {
sortable: true, sortable: true,
field: 'supplier_detail', field: 'supplier_detail',
title: 'Supplier', title: '{% trans "Supplier" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return imageHoverIcon(row.supplier_detail.image) + renderLink(row.supplier_detail.name, `/company/${row.supplier}/purchase-orders/`); return imageHoverIcon(row.supplier_detail.image) + renderLink(row.supplier_detail.name, `/company/${row.supplier}/purchase-orders/`);
} }
}, },
{ {
field: 'supplier_reference', field: 'supplier_reference',
title: 'Supplier Reference', title: '{% trans "Supplier Reference" %}',
sortable: true, sortable: true,
}, },
{ {
sortable: true, sortable: true,
field: 'description', field: 'description',
title: 'Description', title: '{% trans "Description" %}',
}, },
{ {
sortable: true, sortable: true,
field: 'status', field: 'status',
title: 'Status', title: '{% trans "Status" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return purchaseOrderStatusDisplay(row.status, row.status_text); return purchaseOrderStatusDisplay(row.status, row.status_text);
} }
@ -165,12 +167,12 @@ function loadPurchaseOrderTable(table, options) {
{ {
sortable: true, sortable: true,
field: 'creation_date', field: 'creation_date',
title: 'Date', title: '{% trans "Date" %}',
}, },
{ {
sortable: true, sortable: true,
field: 'line_items', field: 'line_items',
title: 'Items' title: '{% trans "Items" %}'
}, },
], ],
}); });
@ -194,7 +196,7 @@ function loadSalesOrderTable(table, options) {
queryParams: filters, queryParams: filters,
groupBy: false, groupBy: false,
original: options.params, original: options.params,
formatNoMatches: function() { return "No sales orders found"; }, formatNoMatches: function() { return "{% trans "No sales orders found" %}"; },
columns: [ columns: [
{ {
field: 'pk', field: 'pk',
@ -204,7 +206,7 @@ function loadSalesOrderTable(table, options) {
{ {
sortable: true, sortable: true,
field: 'reference', field: 'reference',
title: 'Sales Order', title: '{% trans "Sales Order" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return renderLink(value, `/order/sales-order/${row.pk}/`); return renderLink(value, `/order/sales-order/${row.pk}/`);
}, },
@ -212,25 +214,25 @@ function loadSalesOrderTable(table, options) {
{ {
sortable: true, sortable: true,
field: 'customer_detail', field: 'customer_detail',
title: 'Customer', title: '{% trans "Customer" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return imageHoverIcon(row.customer_detail.image) + renderLink(row.customer_detail.name, `/company/${row.customer}/sales-orders/`); return imageHoverIcon(row.customer_detail.image) + renderLink(row.customer_detail.name, `/company/${row.customer}/sales-orders/`);
} }
}, },
{ {
field: 'customer_reference', field: 'customer_reference',
title: 'Customer Reference', title: '{% trans "Customer Reference" %}',
sotrable: true, sotrable: true,
}, },
{ {
sortable: true, sortable: true,
field: 'description', field: 'description',
title: 'Description', title: '{% trans "Description" %}',
}, },
{ {
sortable: true, sortable: true,
field: 'status', field: 'status',
title: 'Status', title: '{% trans "Status" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return salesOrderStatusDisplay(row.status, row.status_text); return salesOrderStatusDisplay(row.status, row.status_text);
} }
@ -238,17 +240,17 @@ function loadSalesOrderTable(table, options) {
{ {
sortable: true, sortable: true,
field: 'creation_date', field: 'creation_date',
title: 'Creation Date', title: '{% trans "Creation Date" %}',
}, },
{ {
sortable: true, sortable: true,
field: 'shipment_date', field: 'shipment_date',
title: "Shipment Date", title: "{% trans "Shipment Date" %}",
}, },
{ {
sortable: true, sortable: true,
field: 'line_items', field: 'line_items',
title: 'Items' title: '{% trans "Items" %}'
}, },
], ],
}); });

View File

@ -1,23 +1,9 @@
{% load i18n %}
/* Part API functions /* Part API functions
* Requires api.js to be loaded first * Requires api.js to be loaded first
*/ */
function getPartCategoryList(filters={}, options={}) {
return inventreeGet('/api/part/category/', filters, options);
}
function getSupplierPartList(filters={}, options={}) {
return inventreeGet('/api/part/supplier/', filters, options);
}
function getPartList(filters={}, options={}) {
return inventreeGet('/api/part/', filters, options);
}
function getBomList(filters={}, options={}) {
return inventreeGet('/api/bom/', filters, options);
}
function toggleStar(options) { function toggleStar(options) {
/* Toggle the 'starred' status of a part. /* Toggle the 'starred' status of a part.
* Performs AJAX queries and updates the display on the button. * Performs AJAX queries and updates the display on the button.
@ -115,14 +101,14 @@ function loadPartTable(table, url, options={}) {
if (options.checkbox) { if (options.checkbox) {
columns.push({ columns.push({
checkbox: true, checkbox: true,
title: 'Select', title: '{% trans 'Select' %}',
searchable: false, searchable: false,
}); });
} }
columns.push({ columns.push({
field: 'name', field: 'name',
title: 'Part', title: '{% trans 'Part' %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
@ -147,19 +133,19 @@ function loadPartTable(table, url, options={}) {
var display = imageHoverIcon(row.thumbnail) + renderLink(name, '/part/' + row.pk + '/'); var display = imageHoverIcon(row.thumbnail) + renderLink(name, '/part/' + row.pk + '/');
if (row.is_template) { if (row.is_template) {
display += `<span class='fas fa-clone label-right' title='Template part'></span>`; display += `<span class='fas fa-clone label-right' title='{% trans "Template part" %}'></span>`;
} }
if (row.assembly) { if (row.assembly) {
display += `<span class='fas fa-tools label-right' title='Assembled part'></span>`; display += `<span class='fas fa-tools label-right' title='{% trans "Assembled part" %}'></span>`;
} }
if (row.starred) { if (row.starred) {
display += `<span class='fas fa-star label-right' title='Starred part'></span>`; display += `<span class='fas fa-star label-right' title='{% trans "Starred part" %}'></span>`;
} }
if (row.salable) { if (row.salable) {
display += `<span class='fas fa-dollar-sign label-right' title='Salable part'></span>`; display += `<span class='fas fa-dollar-sign label-right' title='{% trans "Salable part" %}'></span>`;
} }
/* /*
@ -169,7 +155,7 @@ function loadPartTable(table, url, options={}) {
*/ */
if (!row.active) { if (!row.active) {
display += `<span class='label label-warning label-right'>INACTIVE</span>`; display += `<span class='label label-warning label-right'>{% trans "Inactive" %}</span>`;
} }
return display; return display;
} }
@ -178,7 +164,7 @@ function loadPartTable(table, url, options={}) {
columns.push({ columns.push({
sortable: true, sortable: true,
field: 'description', field: 'description',
title: 'Description', title: '{% trans 'Description' %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (row.is_template) { if (row.is_template) {
@ -192,20 +178,20 @@ function loadPartTable(table, url, options={}) {
columns.push({ columns.push({
sortable: true, sortable: true,
field: 'category_detail', field: 'category_detail',
title: 'Category', title: '{% trans 'Category' %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (row.category) { if (row.category) {
return renderLink(value.pathstring, "/part/category/" + row.category + "/"); return renderLink(value.pathstring, "/part/category/" + row.category + "/");
} }
else { else {
return 'No category'; return '{% trans "No category" %}';
} }
} }
}); });
columns.push({ columns.push({
field: 'in_stock', field: 'in_stock',
title: 'Stock', title: '{% trans "Stock" %}',
searchable: false, searchable: false,
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
@ -216,20 +202,20 @@ function loadPartTable(table, url, options={}) {
// Is stock "low" (below the 'minimum_stock' quantity)? // Is stock "low" (below the 'minimum_stock' quantity)?
if (row.minimum_stock && row.minimum_stock > value) { if (row.minimum_stock && row.minimum_stock > value) {
value += "<span class='label label-right label-warning'>Low stock</span>"; value += "<span class='label label-right label-warning'>{% trans "Low stock" %}</span>";
} }
} else if (row.on_order) { } else if (row.on_order) {
// There is no stock available, but stock is on order // There is no stock available, but stock is on order
value = "0<span class='label label-right label-primary'>On Order : " + row.on_order + "</span>"; value = "0<span class='label label-right label-primary'>{% trans "On Order" %}: " + row.on_order + "</span>";
link = "orders"; link = "orders";
} else if (row.building) { } else if (row.building) {
// There is no stock available, but stock is being built // There is no stock available, but stock is being built
value = "0<span class='label label-right label-info'>Building : " + row.building + "</span>"; value = "0<span class='label label-right label-info'>{% trans "Building" %}: " + row.building + "</span>";
link = "builds"; link = "builds";
} else { } else {
// There is no stock available // There is no stock available
value = "0<span class='label label-right label-danger'>No Stock</span>"; value = "0<span class='label label-right label-danger'>{% trans "No Stock" %}</span>";
} }
return renderLink(value, '/part/' + row.pk + "/" + link + "/"); return renderLink(value, '/part/' + row.pk + "/" + link + "/");
@ -243,7 +229,7 @@ function loadPartTable(table, url, options={}) {
queryParams: filters, queryParams: filters,
groupBy: false, groupBy: false,
original: params, original: params,
formatNoMatches: function() { return "No parts found"; }, formatNoMatches: function() { return "{% trans "No parts found" %}"; },
columns: columns, columns: columns,
}); });

View File

@ -1,20 +1,9 @@
{% load i18n %}
/* Stock API functions /* Stock API functions
* Requires api.js to be loaded first * Requires api.js to be loaded first
*/ */
function getStockList(filters={}, options={}) {
return inventreeGet('/api/stock/', filters, options);
}
function getStockDetail(pk, options={}) {
return inventreeGet('/api/stock/' + pk + '/', {}, options)
}
function getStockLocations(filters={}, options={}) {
return inventreeGet('/api/stock/location/', filters, options)
}
/* Functions for interacting with stock management forms /* Functions for interacting with stock management forms
*/ */
@ -29,7 +18,6 @@ function removeStockRow(e) {
$('#' + row).remove(); $('#' + row).remove();
} }
function loadStockTable(table, options) { function loadStockTable(table, options) {
/* Load data into a stock table with adjustable options. /* Load data into a stock table with adjustable options.
* Fetches data (via AJAX) and loads into a bootstrap table. * Fetches data (via AJAX) and loads into a bootstrap table.
@ -75,7 +63,7 @@ function loadStockTable(table, options) {
table.inventreeTable({ table.inventreeTable({
method: 'get', method: 'get',
formatNoMatches: function() { formatNoMatches: function() {
return 'No stock items matching query'; return '{% trans "No stock items matching query" %}';
}, },
url: options.url, url: options.url,
queryParams: filters, queryParams: filters,
@ -205,7 +193,7 @@ function loadStockTable(table, options) {
columns: [ columns: [
{ {
checkbox: true, checkbox: true,
title: 'Select', title: '{% trans "Select" %}',
searchable: false, searchable: false,
}, },
{ {
@ -215,7 +203,7 @@ function loadStockTable(table, options) {
}, },
{ {
field: 'part_name', field: 'part_name',
title: 'Part', title: '{% trans "Part" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
@ -236,7 +224,7 @@ function loadStockTable(table, options) {
}, },
{ {
field: 'part_description', field: 'part_description',
title: 'Description', title: '{% trans "Description" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return row.part_detail.description; return row.part_detail.description;
@ -244,7 +232,7 @@ function loadStockTable(table, options) {
}, },
{ {
field: 'quantity', field: 'quantity',
title: 'Stock', title: '{% trans "Stock" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
@ -260,12 +248,12 @@ function loadStockTable(table, options) {
var html = renderLink(val, `/stock/item/${row.pk}/`); var html = renderLink(val, `/stock/item/${row.pk}/`);
if (row.allocated) { if (row.allocated) {
html += `<span class='fas fa-bookmark label-right' title='StockItem has been allocated'></span>`; html += `<span class='fas fa-bookmark label-right' title='{% trans "StockItem has been allocated" %}'></span>`;
} }
// 70 = "LOST" // 70 = "LOST"
if (row.status == 70) { if (row.status == 70) {
html += `<span class='fas fa-question-circle label-right' title='StockItem is lost'></span>`; html += `<span class='fas fa-question-circle label-right' title='{% trans "StockItem is lost" %}'></span>`;
} }
return html; return html;
@ -273,7 +261,7 @@ function loadStockTable(table, options) {
}, },
{ {
field: 'status', field: 'status',
title: 'Status', title: '{% trans "Status" %}',
sortable: 'true', sortable: 'true',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return stockStatusDisplay(value); return stockStatusDisplay(value);
@ -281,25 +269,25 @@ function loadStockTable(table, options) {
}, },
{ {
field: 'batch', field: 'batch',
title: 'Batch', title: '{% trans "Batch" %}',
sortable: true, sortable: true,
}, },
{ {
field: 'location_detail.pathstring', field: 'location_detail.pathstring',
title: 'Location', title: '{% trans "Location" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (value) { if (value) {
return renderLink(value, '/stock/location/' + row.location + '/'); return renderLink(value, '/stock/location/' + row.location + '/');
} }
else { else {
return '<i>No stock location set</i>'; return '<i>{% trans "No stock location set" %}</i>';
} }
} }
}, },
{ {
field: 'notes', field: 'notes',
title: 'Notes', title: '{% trans "Notes" %}',
} }
], ],
}); });
@ -389,7 +377,6 @@ function loadStockTable(table, options) {
}); });
} }
function loadStockTrackingTable(table, options) { function loadStockTrackingTable(table, options) {
var cols = [ var cols = [
@ -399,7 +386,7 @@ function loadStockTrackingTable(table, options) {
}, },
{ {
field: 'date', field: 'date',
title: 'Date', title: '{% trans "Date" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var m = moment(value); var m = moment(value);
@ -417,7 +404,7 @@ function loadStockTrackingTable(table, options) {
if (options.partColumn) { if (options.partColumn) {
cols.push({ cols.push({
field: 'item', field: 'item',
title: 'Stock Item', title: '{% trans "Stock Item" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return renderLink(value.part_name, value.url); return renderLink(value.part_name, value.url);
@ -428,7 +415,7 @@ function loadStockTrackingTable(table, options) {
// Stock transaction description // Stock transaction description
cols.push({ cols.push({
field: 'title', field: 'title',
title: 'Description', title: '{% trans "Description" %}',
sortable: true, sortable: true,
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
var html = "<b>" + value + "</b>"; var html = "<b>" + value + "</b>";
@ -447,7 +434,7 @@ function loadStockTrackingTable(table, options) {
cols.push({ cols.push({
field: 'quantity', field: 'quantity',
title: 'Quantity', title: '{% trans "Quantity" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
return parseFloat(value); return parseFloat(value);
}, },
@ -456,7 +443,7 @@ function loadStockTrackingTable(table, options) {
cols.push({ cols.push({
sortable: true, sortable: true,
field: 'user', field: 'user',
title: 'User', title: '{% trans "User" %}',
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
if (value) if (value)
{ {
@ -465,7 +452,7 @@ function loadStockTrackingTable(table, options) {
} }
else else
{ {
return "No user information"; return "{% trans "No user information" %}";
} }
} }
}); });