mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Updated template stock item logic and added to stock locations
This commit is contained in:
parent
4104e7df8e
commit
8dac6bb982
@ -8,21 +8,22 @@
|
|||||||
|
|
||||||
{% include "stock/tabs.html" with tab="tracking" %}
|
{% include "stock/tabs.html" with tab="tracking" %}
|
||||||
|
|
||||||
|
{% setting_object 'STOCK_OWNER' as owner_enable %}
|
||||||
|
|
||||||
<h4>{% trans "Stock Tracking Information" %}</h4>
|
<h4>{% trans "Stock Tracking Information" %}</h4>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<!-- Check permissions and owner -->
|
<!-- Check permissions and owner -->
|
||||||
{% setting_object 'STOCK_OWNER' as owner_enable %}
|
|
||||||
{% if owner_enable.value == "False" or owner_enable.value == "True" and item.owner == user %}
|
{% if owner_enable.value == "False" or owner_enable.value == "True" and item.owner == user %}
|
||||||
{% if roles.stock.change and not item.is_building %}
|
{% if roles.stock.change and not item.is_building %}
|
||||||
<div id='table-toolbar'>
|
<div id='table-toolbar'>
|
||||||
<div class='btn-group'>
|
<div class='btn-group'>
|
||||||
<button class='btn btn-success' type='button' title='New tracking entry' id='new-entry'>
|
<button class='btn btn-success' type='button' title='New tracking entry' id='new-entry'>
|
||||||
<span class='fas fa-plus-circle'></span> {% trans "New Entry" %}
|
<span class='fas fa-plus-circle'></span> {% trans "New Entry" %}
|
||||||
</button>
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{% endif %}
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<table class='table table-condensed table-striped' id='track-table' data-toolbar='#table-toolbar'>
|
<table class='table table-condensed table-striped' id='track-table' data-toolbar='#table-toolbar'>
|
||||||
</table>
|
</table>
|
||||||
|
@ -15,6 +15,8 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
|||||||
{% block pre_content %}
|
{% block pre_content %}
|
||||||
{% include 'stock/loc_link.html' with location=item.location %}
|
{% include 'stock/loc_link.html' with location=item.location %}
|
||||||
|
|
||||||
|
{% setting_object 'STOCK_OWNER' as owner_enable %}
|
||||||
|
|
||||||
{% if item.is_building %}
|
{% if item.is_building %}
|
||||||
<div class='alert alert-block alert-info'>
|
<div class='alert alert-block alert-info'>
|
||||||
{% trans "This stock item is in production and cannot be edited." %}<br>
|
{% trans "This stock item is in production and cannot be edited." %}<br>
|
||||||
@ -29,6 +31,12 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if owner_enable.value == "True" and not item.owner == user and not user.is_superuser %}
|
||||||
|
<div class='alert alert-block alert-info'>
|
||||||
|
{% trans "You are not the owner of this item. This stock item cannot be edited." %}<br>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if item.hasRequiredTests and not item.passedAllRequiredTests %}
|
{% if item.hasRequiredTests and not item.passedAllRequiredTests %}
|
||||||
<div class='alert alert-block alert-danger'>
|
<div class='alert alert-block alert-danger'>
|
||||||
{% trans "This stock item has not passed all required tests" %}
|
{% trans "This stock item has not passed all required tests" %}
|
||||||
@ -68,6 +76,9 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block page_data %}
|
{% block page_data %}
|
||||||
|
|
||||||
|
{% setting_object 'STOCK_OWNER' as owner_enable %}
|
||||||
|
|
||||||
<h3>
|
<h3>
|
||||||
{% trans "Stock Item" %}
|
{% trans "Stock Item" %}
|
||||||
{% stock_status_label item.status large=True %}
|
{% stock_status_label item.status large=True %}
|
||||||
@ -113,8 +124,7 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
|
|||||||
</div>
|
</div>
|
||||||
<!-- Stock adjustment menu -->
|
<!-- Stock adjustment menu -->
|
||||||
<!-- Check permissions and owner -->
|
<!-- Check permissions and owner -->
|
||||||
{% setting_object 'STOCK_OWNER' as owner_enable %}
|
{% if owner_enable.value == "False" or owner_enable.value == "True" and item.owner == user or user.is_superuser %}
|
||||||
{% if owner_enable.value == "False" or owner_enable.value == "True" and item.owner == user %}
|
|
||||||
{% if roles.stock.change and not item.is_building %}
|
{% if roles.stock.change and not item.is_building %}
|
||||||
<div class='btn-group'>
|
<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>
|
<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>
|
||||||
|
@ -1,8 +1,17 @@
|
|||||||
{% extends "stock/stock_app_base.html" %}
|
{% extends "stock/stock_app_base.html" %}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
|
{% load inventree_extras %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
|
{% setting_object 'STOCK_OWNER' as owner_enable %}
|
||||||
|
|
||||||
|
{% if location and owner_enable.value == "True" and not location.owner in user.groups.all and not user.is_superuser %}
|
||||||
|
<div class='alert alert-block alert-info'>
|
||||||
|
{% trans "You are not in the list of owners of this location. This stock location cannot be edited." %}<br>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class='row'>
|
<div class='row'>
|
||||||
<div class='col-sm-6'>
|
<div class='col-sm-6'>
|
||||||
{% if location %}
|
{% if location %}
|
||||||
@ -18,11 +27,13 @@
|
|||||||
<p>{% trans "All stock items" %}</p>
|
<p>{% trans "All stock items" %}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class='btn-group action-buttons' role='group'>
|
<div class='btn-group action-buttons' role='group'>
|
||||||
{% if roles.stock.add %}
|
{% if owner_enable.value == "False" or owner_enable.value == "True" and location.owner in user.groups.all or user.is_superuser or not location %}
|
||||||
<button class='btn btn-default' id='location-create' title='{% trans "Create new stock location" %}'>
|
{% if roles.stock.add %}
|
||||||
<span class='fas fa-plus-circle icon-green'/>
|
<button class='btn btn-default' id='location-create' title='{% trans "Create new stock location" %}'>
|
||||||
</button>
|
<span class='fas fa-plus-circle icon-green'/>
|
||||||
{% endif %}
|
</button>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
<!-- Barcode actions menu -->
|
<!-- Barcode actions menu -->
|
||||||
{% if location %}
|
{% if location %}
|
||||||
<div class='btn-group'>
|
<div class='btn-group'>
|
||||||
@ -33,23 +44,26 @@
|
|||||||
<li><a href='#' id='barcode-check-in'><span class='fas fa-arrow-right'></span> {% trans "Check-in Items" %}</a></li>
|
<li><a href='#' id='barcode-check-in'><span class='fas fa-arrow-right'></span> {% trans "Check-in Items" %}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% if roles.stock.change %}
|
<!-- Check permissions and owner -->
|
||||||
<div class='btn-group'>
|
{% if owner_enable.value == "False" or owner_enable.value == "True" and location.owner in user.groups.all or user.is_superuser %}
|
||||||
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-boxes'></span> <span class='caret'></span></button>
|
{% if roles.stock.change %}
|
||||||
<ul class='dropdown-menu' role='menu'>
|
<div class='btn-group'>
|
||||||
<li><a href='#' id='location-count'><span class='fas fa-clipboard-list'></span>
|
<button id='stock-actions' title='{% trans "Stock actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle='dropdown'><span class='fas fa-boxes'></span> <span class='caret'></span></button>
|
||||||
{% trans "Count stock" %}</a></li>
|
<ul class='dropdown-menu' role='menu'>
|
||||||
</ul>
|
<li><a href='#' id='location-count'><span class='fas fa-clipboard-list'></span>
|
||||||
</div>
|
{% trans "Count stock" %}</a></li>
|
||||||
<div class='btn-group'>
|
</ul>
|
||||||
<button id='location-actions' title='{% trans "Location actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle="dropdown"><span class='fas fa-sitemap'></span> <span class='caret'></span></button>
|
</div>
|
||||||
<ul class='dropdown-menu' role='menu'>
|
<div class='btn-group'>
|
||||||
<li><a href='#' id='location-edit'><span class='fas fa-edit icon-green'></span> {% trans "Edit location" %}</a></li>
|
<button id='location-actions' title='{% trans "Location actions" %}' class='btn btn-default dropdown-toggle' type='button' data-toggle="dropdown"><span class='fas fa-sitemap'></span> <span class='caret'></span></button>
|
||||||
{% if roles.stock.delete %}
|
<ul class='dropdown-menu' role='menu'>
|
||||||
<li><a href='#' id='location-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete location" %}</a></li>
|
<li><a href='#' id='location-edit'><span class='fas fa-edit icon-green'></span> {% trans "Edit location" %}</a></li>
|
||||||
{% endif %}
|
{% if roles.stock.delete %}
|
||||||
</ul>
|
<li><a href='#' id='location-delete'><span class='fas fa-trash-alt icon-red'></span> {% trans "Delete location" %}</a></li>
|
||||||
</div>
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
{% load inventree_extras %}
|
||||||
|
|
||||||
|
{% setting_object 'STOCK_OWNER' as owner_enable %}
|
||||||
|
|
||||||
<div id='button-toolbar'>
|
<div id='button-toolbar'>
|
||||||
<div class='button-toolbar container-fluid' style='float: right;'>
|
<div class='button-toolbar container-fluid' style='float: right;'>
|
||||||
@ -8,28 +11,31 @@
|
|||||||
</button>
|
</button>
|
||||||
{% if read_only %}
|
{% if read_only %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if roles.stock.add %}
|
<!-- Check permissions and owner -->
|
||||||
<button class="btn btn-success" id='item-create'>
|
{% if owner_enable.value == "False" or owner_enable.value == "True" and location.owner in user.groups.all %}
|
||||||
<span class='fas fa-plus-circle'></span> {% trans "New Stock Item" %}
|
{% if roles.stock.add %}
|
||||||
</button>
|
<button class="btn btn-success" id='item-create'>
|
||||||
{% endif %}
|
<span class='fas fa-plus-circle'></span> {% trans "New Stock Item" %}
|
||||||
{% if roles.stock.change or roles.stock.delete %}
|
</button>
|
||||||
<div class="btn-group">
|
|
||||||
<button id='stock-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}<span class="caret"></span></button>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
{% if roles.stock.change %}
|
|
||||||
<li><a href="#" id='multi-item-add' title='{% trans "Add to selected stock items" %}'><span class='fas fa-plus-circle'></span> {% trans "Add stock" %}</a></li>
|
|
||||||
<li><a href="#" id='multi-item-remove' title='{% trans "Remove from selected stock items" %}'><span class='fas fa-minus-circle'></span> {% trans "Remove stock" %}</a></li>
|
|
||||||
<li><a href="#" id='multi-item-stocktake' title='{% trans "Stocktake selected stock items" %}'><span class='fas fa-check-circle'></span> {% trans "Count stock" %}</a></li>
|
|
||||||
<li><a href='#' id='multi-item-move' title='{% trans "Move selected stock items" %}'><span class='fas fa-exchange-alt'></span> {% trans "Move stock" %}</a></li>
|
|
||||||
<li><a href='#' id='multi-item-order' title='{% trans "Order selected items" %}'><span class='fas fa-shopping-cart'></span> {% trans "Order stock" %}</a></li>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if roles.stock.delete %}
|
{% if roles.stock.change or roles.stock.delete %}
|
||||||
<li><a href='#' id='multi-item-delete' title='{% trans "Delete selected items" %}'><span class='fas fa-trash-alt'></span> {% trans "Delete Stock" %}</a></li>
|
<div class="btn-group">
|
||||||
|
<button id='stock-options' class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown">{% trans "Options" %}<span class="caret"></span></button>
|
||||||
|
<ul class="dropdown-menu">
|
||||||
|
{% if roles.stock.change %}
|
||||||
|
<li><a href="#" id='multi-item-add' title='{% trans "Add to selected stock items" %}'><span class='fas fa-plus-circle'></span> {% trans "Add stock" %}</a></li>
|
||||||
|
<li><a href="#" id='multi-item-remove' title='{% trans "Remove from selected stock items" %}'><span class='fas fa-minus-circle'></span> {% trans "Remove stock" %}</a></li>
|
||||||
|
<li><a href="#" id='multi-item-stocktake' title='{% trans "Stocktake selected stock items" %}'><span class='fas fa-check-circle'></span> {% trans "Count stock" %}</a></li>
|
||||||
|
<li><a href='#' id='multi-item-move' title='{% trans "Move selected stock items" %}'><span class='fas fa-exchange-alt'></span> {% trans "Move stock" %}</a></li>
|
||||||
|
<li><a href='#' id='multi-item-order' title='{% trans "Order selected items" %}'><span class='fas fa-shopping-cart'></span> {% trans "Order stock" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
{% if roles.stock.delete %}
|
||||||
|
<li><a href='#' id='multi-item-delete' title='{% trans "Delete selected items" %}'><span class='fas fa-trash-alt'></span> {% trans "Delete Stock" %}</a></li>
|
||||||
|
{% endif %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
{% endif %}
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
<div class='filter-list' id='filter-list-stock'>
|
<div class='filter-list' id='filter-list-stock'>
|
||||||
|
Loading…
Reference in New Issue
Block a user