2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 21:45:39 +00:00

Make this setting a per-user setting

This commit is contained in:
Oliver
2021-10-06 22:22:20 +11:00
parent 166af3592d
commit d9fddf64f1
7 changed files with 40 additions and 11 deletions

View File

@ -42,6 +42,12 @@
</a>
</li>
<li class='list-group-item' title='{% trans "Forms" %}'>
<a href='#' class='nav-toggle' id='select-user-forms'>
<span class='fas fa-table'></span>{% trans "Forms" %}
</a>
</li>
<!--
<li class='list-group-item' title='{% trans "Settings" %}'>
<a href='#' class='nav-toggle' id='select-user-settings'>

View File

@ -17,7 +17,6 @@
{% include "InvenTree/settings/setting.html" with key="PART_IPN_REGEX" %}
{% 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_SHOW_RELATED" icon="fa-random" %}
{% include "InvenTree/settings/setting.html" with key="PART_CREATE_INITIAL" icon="fa-boxes" %}

View File

@ -20,6 +20,7 @@
{% include "InvenTree/settings/user_search.html" %}
{% include "InvenTree/settings/user_labels.html" %}
{% include "InvenTree/settings/user_reports.html" %}
{% include "InvenTree/settings/user_forms.html" %}
{% if user.is_staff %}

View File

@ -0,0 +1,22 @@
{% extends "panel.html" %}
{% load i18n %}
{% load inventree_extras %}
{% block label %}user-forms{% endblock %}
{% block heading %}
{% trans "Form Settings" %}
{% endblock %}
{% block content %}
<div class='row'>
<table class='table table-striped table-condensed'>
<tbody>
{% include "InvenTree/settings/setting.html" with key="PART_SHOW_QUANTITY_IN_FORMS" icon="fa-hashtag" user_setting=True %}
</tbody>
</table>
</div>
{% endblock %}

View File

@ -162,7 +162,7 @@ function renderPart(name, data, parameters, options) {
var stock = '';
// Display available part quantity
if (global_settings.PART_SHOW_QUANTITY_IN_FORMS) {
if (user_settings.PART_SHOW_QUANTITY_IN_FORMS) {
if (data.in_stock == 0) {
stock = `<span class='label-form label-red'>{% trans "No Stock" %}</span>`;
} else {