Optionally include javascript code based on barcode feature

This commit is contained in:
Oliver Walters 2021-01-28 21:51:34 +11:00
parent 4641123cd8
commit 5e5bced0c7
2 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@
* Requires api.js to be loaded first
*/
{% settings_value 'BARCODE_ENABLE' as barcodes %}
function stockStatusCodes() {
return [
@ -635,7 +636,9 @@ function loadStockTable(table, options) {
table,
[
'#stock-print-options',
{% if barcodes %}
'#stock-barcode-options',
{% endif %}
'#stock-options',
]
);
@ -701,6 +704,7 @@ function loadStockTable(table, options) {
printTestReports(items);
})
{% if barcodes %}
$('#multi-item-barcode-scan-into-location').click(function() {
var selections = $('#stock-table').bootstrapTable('getSelections');
@ -712,6 +716,7 @@ function loadStockTable(table, options) {
scanItemsIntoLocation(items);
});
{% endif %}
$('#multi-item-stocktake').click(function() {
stockAdjustment('count');

View File

@ -1,6 +1,8 @@
{% load i18n %}
{% load inventree_extras %}
{% settings_value 'BARCODE_ENABLE' as barcodes %}
{% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %}
{% if owner_control.value == "True" %}
{% authorized_owners location.owner as owners %}
@ -19,7 +21,6 @@
<span class='fas fa-plus-circle'></span>
</button>
{% endif %}
{% settings_value 'BARCODE_ENABLE' as barcodes %}
{% if barcodes %}
<!-- Barcode actions menu -->
<div class='btn-group'>