mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Template cleanup
This commit is contained in:
parent
6fe5f0e0e6
commit
4381a16b0e
@ -82,7 +82,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
var prefix = '{% settings_value "BUILDORDER_REFERENCE_PREFIX" %}';
|
var prefix = global_settings.BUILDORDER_REFERENCE_PREFIX;
|
||||||
|
|
||||||
for (var idx = 0; idx < response.length; idx++) {
|
for (var idx = 0; idx < response.length; idx++) {
|
||||||
|
|
||||||
|
@ -812,6 +812,7 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
|||||||
help_text=_('Settings key (must be unique - case insensitive'),
|
help_text=_('Settings key (must be unique - case insensitive'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class InvenTreeUserSetting(BaseInvenTreeSetting):
|
class InvenTreeUserSetting(BaseInvenTreeSetting):
|
||||||
"""
|
"""
|
||||||
An InvenTreeSetting object with a usercontext
|
An InvenTreeSetting object with a usercontext
|
||||||
|
@ -198,9 +198,8 @@
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
{% settings_value "INVENTREE_DOWNLOAD_FROM_URL" as allow_download %}
|
if (global_settings.INVENTREE_DOWNLOAD_FROM_URL) {
|
||||||
|
|
||||||
{% if allow_download %}
|
|
||||||
$('#company-image-url').click(function() {
|
$('#company-image-url').click(function() {
|
||||||
launchModalForm(
|
launchModalForm(
|
||||||
'{% url "company-image-download" company.id %}',
|
'{% url "company-image-download" company.id %}',
|
||||||
@ -209,6 +208,6 @@
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
{% endif %}
|
}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -164,7 +164,7 @@ $("#edit-order").click(function() {
|
|||||||
constructForm('{% url "api-po-detail" order.pk %}', {
|
constructForm('{% url "api-po-detail" order.pk %}', {
|
||||||
fields: {
|
fields: {
|
||||||
reference: {
|
reference: {
|
||||||
prefix: "{% settings_value 'PURCHASEORDER_REFERENCE_PREFIX' %}",
|
prefix: global_settings.PURCHASEORDER_REFERENCE_PREFIX,
|
||||||
},
|
},
|
||||||
{% if order.lines.count == 0 and order.status == PurchaseOrderStatus.PENDING %}
|
{% if order.lines.count == 0 and order.status == PurchaseOrderStatus.PENDING %}
|
||||||
supplier: {
|
supplier: {
|
||||||
|
@ -157,7 +157,7 @@ $("#edit-order").click(function() {
|
|||||||
constructForm('{% url "api-so-detail" order.pk %}', {
|
constructForm('{% url "api-so-detail" order.pk %}', {
|
||||||
fields: {
|
fields: {
|
||||||
reference: {
|
reference: {
|
||||||
prefix: "{% settings_value 'SALESORDER_REFERENCE_PREFIX' %}",
|
prefix: global_settings.SALESORDER_REFERENCE_PREFIX,
|
||||||
},
|
},
|
||||||
{% if order.lines.count == 0 and order.status == SalesOrderStatus.PENDING %}
|
{% if order.lines.count == 0 and order.status == SalesOrderStatus.PENDING %}
|
||||||
customer: {
|
customer: {
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
{
|
{
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
|
||||||
var prefix = '{% settings_value "SALESORDER_REFERENCE_PREFIX" %}';
|
var prefix = global_settings.SALESORDER_REFERENCE_PREFIX;
|
||||||
|
|
||||||
for (var idx = 0; idx < response.length; idx++) {
|
for (var idx = 0; idx < response.length; idx++) {
|
||||||
var order = response[idx];
|
var order = response[idx];
|
||||||
|
@ -394,8 +394,7 @@
|
|||||||
|
|
||||||
{% if roles.part.change %}
|
{% if roles.part.change %}
|
||||||
|
|
||||||
{% settings_value "INVENTREE_DOWNLOAD_FROM_URL" as allow_download %}
|
if (global_settings.INVENTREE_DOWNLOAD_FROM_URL) {
|
||||||
{% if allow_download %}
|
|
||||||
$("#part-image-url").click(function() {
|
$("#part-image-url").click(function() {
|
||||||
launchModalForm(
|
launchModalForm(
|
||||||
'{% url "part-image-download" part.id %}',
|
'{% url "part-image-download" part.id %}',
|
||||||
@ -404,7 +403,7 @@
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
{% endif %}
|
}
|
||||||
|
|
||||||
$("#part-image-select").click(function() {
|
$("#part-image-select").click(function() {
|
||||||
launchModalForm("{% url 'part-image-select' part.id %}",
|
launchModalForm("{% url 'part-image-select' part.id %}",
|
||||||
|
@ -91,11 +91,7 @@ function inventreeDocReady() {
|
|||||||
url: '/api/part/',
|
url: '/api/part/',
|
||||||
data: {
|
data: {
|
||||||
search: request.term,
|
search: request.term,
|
||||||
{% if request.user %}
|
limit: user_settings.SEARCH_PREVIEW_RESULTS,
|
||||||
limit: {% settings_value 'SEARCH_PREVIEW_RESULTS' user=request.user %},
|
|
||||||
{% else %}
|
|
||||||
limit: 25,
|
|
||||||
{% endif %}
|
|
||||||
offset: 0
|
offset: 0
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
function buildFormFields() {
|
function buildFormFields() {
|
||||||
return {
|
return {
|
||||||
reference: {
|
reference: {
|
||||||
prefix: "{% settings_value 'BUILDORDER_REFERENCE_PREFIX' %}",
|
prefix: global_settings.BUILDORDER_REFERENCE_PREFIX,
|
||||||
},
|
},
|
||||||
title: {},
|
title: {},
|
||||||
part: {},
|
part: {},
|
||||||
@ -232,7 +232,7 @@ function loadBuildOrderAllocationTable(table, options={}) {
|
|||||||
switchable: false,
|
switchable: false,
|
||||||
title: '{% trans "Build Order" %}',
|
title: '{% trans "Build Order" %}',
|
||||||
formatter: function(value, row) {
|
formatter: function(value, row) {
|
||||||
var prefix = "{% settings_value 'BUILDORDER_REFERENCE_PREFIX' %}";
|
var prefix = global_settings.BUILDORDER_REFERENCE_PREFIX;
|
||||||
|
|
||||||
var ref = `${prefix}${row.build_detail.reference}`;
|
var ref = `${prefix}${row.build_detail.reference}`;
|
||||||
|
|
||||||
@ -848,7 +848,7 @@ function loadBuildTable(table, options) {
|
|||||||
switchable: true,
|
switchable: true,
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
|
|
||||||
var prefix = "{% settings_value 'BUILDORDER_REFERENCE_PREFIX' %}";
|
var prefix = global_settings.BUILDORDER_REFERENCE_PREFIX;
|
||||||
|
|
||||||
if (prefix) {
|
if (prefix) {
|
||||||
value = `${prefix}${value}`;
|
value = `${prefix}${value}`;
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
* Requires api.js to be loaded first
|
* Requires api.js to be loaded first
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{% settings_value 'BARCODE_ENABLE' as barcodes %}
|
|
||||||
|
|
||||||
function stockStatusCodes() {
|
function stockStatusCodes() {
|
||||||
return [
|
return [
|
||||||
{% for code in StockStatus.list %}
|
{% for code in StockStatus.list %}
|
||||||
@ -1037,7 +1035,7 @@ function loadStockTable(table, options) {
|
|||||||
|
|
||||||
if (row.purchase_order_reference) {
|
if (row.purchase_order_reference) {
|
||||||
|
|
||||||
var prefix = '{% settings_value "PURCHASEORDER_REFERENCE_PREFIX" %}';
|
var prefix = global_settings.PURCHASEORDER_REFERENCE_PREFIX;
|
||||||
|
|
||||||
text = prefix + row.purchase_order_reference;
|
text = prefix + row.purchase_order_reference;
|
||||||
}
|
}
|
||||||
@ -1090,15 +1088,18 @@ function loadStockTable(table, options) {
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
var buttons = [
|
||||||
|
'#stock-print-options',
|
||||||
|
'#stock-options';
|
||||||
|
];
|
||||||
|
|
||||||
|
if (global_settings.BARCODE_ENABLE) {
|
||||||
|
buttons.push('#stock-barcode-options');
|
||||||
|
}
|
||||||
|
|
||||||
linkButtonsToSelection(
|
linkButtonsToSelection(
|
||||||
table,
|
table,
|
||||||
[
|
buttons,
|
||||||
'#stock-print-options',
|
|
||||||
{% if barcodes %}
|
|
||||||
'#stock-barcode-options',
|
|
||||||
{% endif %}
|
|
||||||
'#stock-options',
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -1138,7 +1139,7 @@ function loadStockTable(table, options) {
|
|||||||
printTestReports(items);
|
printTestReports(items);
|
||||||
})
|
})
|
||||||
|
|
||||||
{% if barcodes %}
|
if (global_settings.BARCODE_ENABLE) {
|
||||||
$('#multi-item-barcode-scan-into-location').click(function() {
|
$('#multi-item-barcode-scan-into-location').click(function() {
|
||||||
var selections = $('#stock-table').bootstrapTable('getSelections');
|
var selections = $('#stock-table').bootstrapTable('getSelections');
|
||||||
|
|
||||||
@ -1150,7 +1151,7 @@ function loadStockTable(table, options) {
|
|||||||
|
|
||||||
scanItemsIntoLocation(items);
|
scanItemsIntoLocation(items);
|
||||||
});
|
});
|
||||||
{% endif %}
|
}
|
||||||
|
|
||||||
$('#multi-item-stocktake').click(function() {
|
$('#multi-item-stocktake').click(function() {
|
||||||
stockAdjustment('count');
|
stockAdjustment('count');
|
||||||
|
Loading…
Reference in New Issue
Block a user