diff --git a/src/backend/InvenTree/common/models.py b/src/backend/InvenTree/common/models.py index e7a3827c8e..3e49bbef71 100644 --- a/src/backend/InvenTree/common/models.py +++ b/src/backend/InvenTree/common/models.py @@ -1391,6 +1391,12 @@ class InvenTreeSetting(BaseInvenTreeSetting): 'default': True, 'validator': bool, }, + 'BARCODE_SHOW_TEXT': { + 'name': _('Barcode Show Data'), + 'description': _('Display barcode data in browser as text'), + 'default': False, + 'validator': bool, + }, 'PART_ENABLE_REVISION': { 'name': _('Part Revisions'), 'description': _('Enable revision field for Part'), diff --git a/src/backend/InvenTree/templates/InvenTree/settings/barcode.html b/src/backend/InvenTree/templates/InvenTree/settings/barcode.html index 3e6fb6835b..982548a58c 100644 --- a/src/backend/InvenTree/templates/InvenTree/settings/barcode.html +++ b/src/backend/InvenTree/templates/InvenTree/settings/barcode.html @@ -15,6 +15,7 @@ {% include "InvenTree/settings/setting.html" with key="BARCODE_ENABLE" icon="fa-qrcode" %} {% include "InvenTree/settings/setting.html" with key="BARCODE_INPUT_DELAY" icon="fa-hourglass-half" %} {% include "InvenTree/settings/setting.html" with key="BARCODE_WEBCAM_SUPPORT" icon="fa-video" %} + {% include "InvenTree/settings/setting.html" with key="BARCODE_SHOW_TEXT" icon="fa-closed-captioning" %} diff --git a/src/backend/InvenTree/templates/js/translated/modals.js b/src/backend/InvenTree/templates/js/translated/modals.js index 16d823e593..6957ed133c 100644 --- a/src/backend/InvenTree/templates/js/translated/modals.js +++ b/src/backend/InvenTree/templates/js/translated/modals.js @@ -1,6 +1,7 @@ {% load i18n %} /* globals + global_settings, inventreeGet, QRCode, showAlertOrCache, @@ -645,10 +646,14 @@ function showAlertDialog(title, content, options={}) { function showQRDialog(title, data, options={}) { let content = ` -
+
`; + if (global_settings.BARCODE_SHOW_TEXT) { + content += `
${data}
`; + } + options.after_render = function(modal) { let qrcode = new QRCode('qrcode', { width: 256, diff --git a/src/frontend/src/pages/Index/Settings/SystemSettings.tsx b/src/frontend/src/pages/Index/Settings/SystemSettings.tsx index 9a25f715d6..69d5ef6953 100644 --- a/src/frontend/src/pages/Index/Settings/SystemSettings.tsx +++ b/src/frontend/src/pages/Index/Settings/SystemSettings.tsx @@ -97,7 +97,8 @@ export default function SystemSettings() { keys={[ 'BARCODE_ENABLE', 'BARCODE_INPUT_DELAY', - 'BARCODE_WEBCAM_SUPPORT' + 'BARCODE_WEBCAM_SUPPORT', + 'BARCODE_SHOW_TEXT' ]} /> )