mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Added global setting and updated stock item templates
This commit is contained in:
parent
e1fb7e5d98
commit
2c38be2d13
@ -139,6 +139,13 @@ class InvenTreeSetting(models.Model):
|
||||
'validator': bool,
|
||||
},
|
||||
|
||||
'STOCK_OWNER': {
|
||||
'name': _('Stock Owner Changes'),
|
||||
'description': _('Allow only owner of stock location and item to make changes'),
|
||||
'default': False,
|
||||
'validator': bool,
|
||||
},
|
||||
|
||||
'BUILDORDER_REFERENCE_PREFIX': {
|
||||
'name': _('Build Order Reference Prefix'),
|
||||
'description': _('Prefix value for build order reference'),
|
||||
|
@ -11,7 +11,9 @@
|
||||
<h4>{% trans "Stock Tracking Information" %}</h4>
|
||||
<hr>
|
||||
|
||||
{% if roles.stock.change %}
|
||||
<!-- Check permissions and owner -->
|
||||
{% setting_object 'STOCK_OWNER' as owner_enable %}
|
||||
{% if user.is_superuser or roles.stock.change and item.owner == user and owner_enable.value == "True" %}
|
||||
<div id='table-toolbar'>
|
||||
<div class='btn-group'>
|
||||
<button class='btn btn-success' type='button' title='New tracking entry' id='new-entry'>
|
||||
|
@ -112,7 +112,10 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
||||
</ul>
|
||||
</div>
|
||||
<!-- Stock adjustment menu -->
|
||||
{% if roles.stock.change and not item.is_building %}
|
||||
<!-- Check permissions and owner -->
|
||||
{% setting_object 'STOCK_OWNER' as owner_enable %}
|
||||
{% if user.is_superuser or roles.stock.change and item.owner == user and owner_enable.value == "True" %}
|
||||
{% if not item.is_building %}
|
||||
<div class='btn-group'>
|
||||
<button id='stock-options' title='{% trans "Stock adjustment actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-boxes'></span> <span class='caret'></span></button>
|
||||
<ul class='dropdown-menu' role='menu'>
|
||||
@ -161,6 +164,8 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
<!-- Check permissions and owner -->
|
||||
{% endif %}
|
||||
<button type='button' class='btn btn-default' id='stock-test-report' title='{% trans "Generate test report" %}'>
|
||||
<span class='fas fa-file-invoice'/>
|
||||
</button>
|
||||
|
@ -10,4 +10,14 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block settings %}
|
||||
|
||||
<h4>{% trans "Stock Options" %}</h4>
|
||||
|
||||
<table class='table table-striped table-condensed'>
|
||||
<thead></thead>
|
||||
<tbody>
|
||||
{% include "InvenTree/settings/setting.html" with key="STOCK_OWNER" %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
@ -1,6 +1,5 @@
|
||||
{% load i18n %}
|
||||
|
||||
{% if roles.stock.change %}
|
||||
<div id='attachment-buttons'>
|
||||
<div class='btn-group'>
|
||||
<button type='button' class='btn btn-success' id='new-attachment'>
|
||||
@ -8,7 +7,6 @@
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class='dropzone' id='attachment-dropzone'>
|
||||
<table class='table table-striped table-condensed' data-toolbar='#attachment-buttons' id='attachment-table'>
|
||||
|
Loading…
Reference in New Issue
Block a user