mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-10-30 04:35:42 +00:00 
			
		
		
		
	Move status messages for stock item
This commit is contained in:
		| @@ -901,6 +901,14 @@ input[type="submit"] { | ||||
|     color: #e00; | ||||
| } | ||||
|  | ||||
| .info-messages { | ||||
|     padding: 5px; | ||||
| } | ||||
|  | ||||
| .info-messages .alert { | ||||
|     padding: 5px; | ||||
| } | ||||
|  | ||||
| .part-allocation { | ||||
|     padding: 3px 10px; | ||||
|     border: 1px solid #ccc; | ||||
|   | ||||
| @@ -14,68 +14,6 @@ | ||||
|  | ||||
| {% block pre_content %} | ||||
| {% include 'stock/loc_link.html' with location=item.location %} | ||||
|  | ||||
| {% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %} | ||||
| {% if owner_control.value == "True" %} | ||||
|     {% authorized_owners item.owner as owners %} | ||||
|  | ||||
|     {% if not user in owners and not user.is_superuser %} | ||||
|     <div class='alert alert-block alert-info'> | ||||
|         {% trans "You are not in the list of owners of this item. This stock item cannot be edited." %}<br> | ||||
|     </div> | ||||
|     {% endif %} | ||||
| {% endif %} | ||||
|  | ||||
| {% if item.is_building %} | ||||
| <div class='alert alert-block alert-info'> | ||||
|     {% trans "This stock item is in production and cannot be edited." %}<br> | ||||
|     {% trans "Edit the stock item from the build view." %}<br> | ||||
|  | ||||
|     {% if item.build %} | ||||
|     <a href="{% url 'build-detail' item.build.id %}"> | ||||
|         <b>{{ item.build }}</b> | ||||
|     </a> | ||||
|     {% endif %} | ||||
|  | ||||
| </div> | ||||
| {% endif %} | ||||
|  | ||||
| {% if item.hasRequiredTests and not item.passedAllRequiredTests %} | ||||
| <div class='alert alert-block alert-danger'> | ||||
|     {% trans "This stock item has not passed all required tests" %} | ||||
| </div> | ||||
| {% endif %} | ||||
|  | ||||
| {% for allocation in item.sales_order_allocations.all %} | ||||
| <div class='alert alert-block alert-info'> | ||||
|     {% object_link 'so-detail' allocation.line.order.id allocation.line.order as link %} | ||||
|     {% decimal allocation.quantity as qty %} | ||||
|     {% blocktrans %}This stock item is allocated to Sales Order {{ link }} (Quantity: {{ qty }}){% endblocktrans %} | ||||
| </div> | ||||
| {% endfor %} | ||||
|  | ||||
| {% for allocation in item.allocations.all %} | ||||
| <div class='alert alert-block alert-info'> | ||||
|     {% object_link 'build-detail' allocation.build.id allocation.build %} | ||||
|     {% decimal allocation.quantity as qty %} | ||||
|     {% blocktrans %}This stock item is allocated to Build {{ link }} (Quantity: {{ qty }}){% endblocktrans %} | ||||
| </div> | ||||
| {% endfor %} | ||||
|  | ||||
| {% if item.serialized %} | ||||
| <div class='alert alert-block alert-warning'> | ||||
|     {% trans "This stock item is serialized - it has a unique serial number and the quantity cannot be adjusted." %} | ||||
| </div> | ||||
| {% elif item.child_count > 0 %} | ||||
| <div class='alert alert-block alert-warning'> | ||||
|     {% trans "This stock item cannot be deleted as it has child items" %} | ||||
| </div> | ||||
| {% elif item.delete_on_deplete and item.can_delete %} | ||||
| <div class='alert alert-block alert-warning'> | ||||
|     {% trans "This stock item will be automatically deleted when all stock is depleted." %} | ||||
| </div> | ||||
| {% endif %} | ||||
|  | ||||
| {% endblock %} | ||||
|  | ||||
| {% block thumbnail %} | ||||
| @@ -221,6 +159,73 @@ | ||||
|  | ||||
| {% endblock %} | ||||
|  | ||||
| {% block below_thumbnail %} | ||||
| <div class='info-messages'> | ||||
|  | ||||
|     {% setting_object 'STOCK_OWNERSHIP_CONTROL' as owner_control %} | ||||
|     {% if owner_control.value == "True" %} | ||||
|         {% authorized_owners item.owner as owners %} | ||||
|  | ||||
|         {% if not user in owners and not user.is_superuser %} | ||||
|         <div class='alert alert-block alert-info'> | ||||
|             {% trans "You are not in the list of owners of this item. This stock item cannot be edited." %}<br> | ||||
|         </div> | ||||
|         {% endif %} | ||||
|     {% endif %} | ||||
|  | ||||
|     {% if item.is_building %} | ||||
|     <div class='alert alert-block alert-info'> | ||||
|         {% trans "This stock item is in production and cannot be edited." %}<br> | ||||
|         {% trans "Edit the stock item from the build view." %}<br> | ||||
|  | ||||
|         {% if item.build %} | ||||
|         <a href="{% url 'build-detail' item.build.id %}"> | ||||
|             <b>{{ item.build }}</b> | ||||
|         </a> | ||||
|         {% endif %} | ||||
|  | ||||
|     </div> | ||||
|     {% endif %} | ||||
|  | ||||
|     {% if item.hasRequiredTests and not item.passedAllRequiredTests %} | ||||
|     <div class='alert alert-block alert-danger'> | ||||
|         {% trans "This stock item has not passed all required tests" %} | ||||
|     </div> | ||||
|     {% endif %} | ||||
|  | ||||
|     {% for allocation in item.sales_order_allocations.all %} | ||||
|     <div class='alert alert-block alert-info'> | ||||
|         {% object_link 'so-detail' allocation.line.order.id allocation.line.order as link %} | ||||
|         {% decimal allocation.quantity as qty %} | ||||
|         {% blocktrans %}This stock item is allocated to Sales Order {{ link }} (Quantity: {{ qty }}){% endblocktrans %} | ||||
|     </div> | ||||
|     {% endfor %} | ||||
|  | ||||
|     {% for allocation in item.allocations.all %} | ||||
|     <div class='alert alert-block alert-info'> | ||||
|         {% object_link 'build-detail' allocation.build.id allocation.build %} | ||||
|         {% decimal allocation.quantity as qty %} | ||||
|         {% blocktrans %}This stock item is allocated to Build {{ link }} (Quantity: {{ qty }}){% endblocktrans %} | ||||
|     </div> | ||||
|     {% endfor %} | ||||
|      | ||||
|     {% if item.serialized %} | ||||
|     <div class='alert alert-block alert-warning'> | ||||
|         {% trans "This stock item is serialized - it has a unique serial number and the quantity cannot be adjusted." %} | ||||
|     </div> | ||||
|     {% elif item.child_count > 0 %} | ||||
|     <div class='alert alert-block alert-warning'> | ||||
|         {% trans "This stock item cannot be deleted as it has child items" %} | ||||
|     </div> | ||||
|     {% elif item.delete_on_deplete and item.can_delete %} | ||||
|     <div class='alert alert-block alert-warning'> | ||||
|         {% trans "This stock item will be automatically deleted when all stock is depleted." %} | ||||
|     </div> | ||||
|     {% endif %} | ||||
|      | ||||
| </div> | ||||
| {% endblock %} | ||||
|  | ||||
| {% block page_details %} | ||||
| <h4>{% trans "Stock Item Details" %}</h4> | ||||
| <table class="table table-striped"> | ||||
|   | ||||
| @@ -27,6 +27,8 @@ | ||||
|                 <!-- Data next to image goes here --> | ||||
|                 {% endblock %} | ||||
|             </div> | ||||
|             {% block below_thumbnail %} | ||||
|             {% endblock %} | ||||
|         </div> | ||||
|         <div class='col-sm-6'> | ||||
|             {% block page_details %} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user