Add UI hooks for displaying stocktake data for a particular part

This commit is contained in:
Oliver 2022-12-16 13:30:37 +11:00
parent 1699e5d6d1
commit e4306f090d
5 changed files with 35 additions and 0 deletions

View File

@ -1754,6 +1754,13 @@ class InvenTreeUserSetting(BaseInvenTreeSetting):
'validator': bool,
},
'DISPLAY_STOCKTAKE_TAB': {
'name': _('Part Stocktake'),
'description': _('Display part stocktake information'),
'default': True,
'validator': bool,
},
'TABLE_STRING_MAX_LENGTH': {
'name': _('Table String Length'),
'description': _('Maximimum length limit for strings displayed in table views'),

View File

@ -53,6 +53,24 @@
</div>
{% endif %}
{% settings_value 'DISPLAY_STOCKTAKE_TAB' user=request.user as show_stocktake %}
{% if show_stocktake %}
<div class='panel panel-hidden' id='panel-stocktake'>
<div class='panel-heading'>
<div class='d-flex flex-wrap'>
<h4>{% trans "Part Stocktake" %}</h4>
{% include "spacer.html" %}
<div class='btn-group' role='group'>
buttons
</div>
</div>
</div>
<div class='panel-content'>
{% include "part/part_stocktake.html" %}
</div>
</div>
{% endif %}
<div class='panel panel-hidden' id='panel-test-templates'>
<div class='panel-heading'>
<div class='d-flex flex-wrap'>

View File

@ -44,6 +44,11 @@
{% trans "Scheduling" as text %}
{% include "sidebar_item.html" with label="scheduling" text=text icon="fa-calendar-alt" %}
{% endif %}
{% settings_value 'DISPLAY_STOCKTAKE_TAB' user=request.user as show_stocktake %}
{% if show_stocktake %}
{% trans "Stocktake" as text %}
{% include "sidebar_item.html" with label="stocktake" text=text icon="fa-clipboard-check" %}
{% endif %}
{% if part.trackable %}
{% trans "Test Templates" as text %}
{% include "sidebar_item.html" with label="test-templates" text=text icon="fa-vial" %}

View File

@ -0,0 +1,4 @@
{% load i18n %}
{% load inventree_extras %}
part scheduling information to appear here

View File

@ -19,6 +19,7 @@
{% include "InvenTree/settings/setting.html" with key="FORMS_CLOSE_USING_ESCAPE" icon="fa-window-close" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="PART_SHOW_QUANTITY_IN_FORMS" icon="fa-hashtag" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="DISPLAY_SCHEDULE_TAB" icon="fa-calendar-alt" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="DISPLAY_STOCKTAKE_TAB" icon="fa-clipboard-check" user_setting=True %}
{% include "InvenTree/settings/setting.html" with key="TABLE_STRING_MAX_LENGTH" icon="fa-table" user_setting=True %}
</tbody>
</table>