From 2d8b96a6b8eff120a8292c8a212cc5fc6b9104e4 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 17 Jun 2021 23:15:42 +0200 Subject: [PATCH] setting to control visibility of price --- InvenTree/common/models.py | 7 +++++++ .../order/templates/order/order_wizard/select_parts.html | 1 + InvenTree/templates/InvenTree/settings/part.html | 1 + 3 files changed, 9 insertions(+) diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index ec76475901..d19f0662dd 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -205,6 +205,13 @@ class InvenTreeSetting(models.Model): 'validator': bool, }, + 'PART_SHOW_PRICE_IN_FORMS': { + 'name': _('Show Price in Forms'), + 'description': _('Display part price in some forms'), + 'default': True, + 'validator': bool, + }, + 'REPORT_DEBUG_MODE': { 'name': _('Debug Mode'), 'description': _('Generate reports in debug mode (HTML output)'), diff --git a/InvenTree/order/templates/order/order_wizard/select_parts.html b/InvenTree/order/templates/order/order_wizard/select_parts.html index 28b4a36213..90fb63a080 100644 --- a/InvenTree/order/templates/order/order_wizard/select_parts.html +++ b/InvenTree/order/templates/order/order_wizard/select_parts.html @@ -4,6 +4,7 @@ {% load i18n %} {% block form %} +{% settings_value 'PART_SHOW_PRICE_IN_FORMS' as show_price %}

{% trans "Step 1 of 2 - Select Part Suppliers" %} diff --git a/InvenTree/templates/InvenTree/settings/part.html b/InvenTree/templates/InvenTree/settings/part.html index e359acdfc2..cb4726bdc4 100644 --- a/InvenTree/templates/InvenTree/settings/part.html +++ b/InvenTree/templates/InvenTree/settings/part.html @@ -20,6 +20,7 @@ {% include "InvenTree/settings/setting.html" with key="PART_ALLOW_DUPLICATE_IPN" %} {% include "InvenTree/settings/setting.html" with key="PART_ALLOW_EDIT_IPN" %} {% include "InvenTree/settings/setting.html" with key="PART_SHOW_QUANTITY_IN_FORMS" icon="fa-hashtag" %} + {% include "InvenTree/settings/setting.html" with key="PART_SHOW_PRICE_IN_FORMS" icon="fa-dollar-sign" %} {% include "InvenTree/settings/setting.html" with key="PART_RECENT_COUNT" icon="fa-clock" %} {% include "InvenTree/settings/setting.html" with key="PART_TEMPLATE" icon="fa-clone" %}