mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Catch unhandled javascript errors
This commit is contained in:
parent
ff71fe6e93
commit
a2c3c1086c
@ -161,7 +161,7 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
||||
<tr>
|
||||
<td><span class='fas fa-user-tie'></span></td>
|
||||
<td>{% trans "Customer" %}</td>
|
||||
<td><a href="{% url 'company-detail' item.customer.id %}">{{ item.customer.name }}</a></td>
|
||||
<td><a href="{% url 'company-detail-assigned-stock' item.customer.id %}">{{ item.customer.name }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if item.belongs_to %}
|
||||
|
@ -18,14 +18,18 @@ function {{ label }}StatusDisplay(key) {
|
||||
|
||||
key = String(key);
|
||||
|
||||
var value = {{ label }}Codes[key].value;
|
||||
var value = null;
|
||||
var label = null;
|
||||
|
||||
if (key in {{ label }}Codes) {
|
||||
value = {{ label }}Codes[key].value;
|
||||
label = {{ label }}Codes[key].label;
|
||||
}
|
||||
|
||||
if (value == null || value.length == 0) {
|
||||
value = key;
|
||||
label = '';
|
||||
}
|
||||
|
||||
// Select the label color
|
||||
var label = {{ label }}Codes[key].label ?? '';
|
||||
|
||||
return `<span class='label ${label}'>${value}</span>`;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user