mirror of
https://github.com/inventree/InvenTree.git
synced 2025-08-14 07:31:10 +00:00
Add view for BomItem model
- Create BOM item (auto-add to a parent part) - Edit / delete - View details
This commit is contained in:
5
InvenTree/part/templates/part/bom-create.html
Normal file
5
InvenTree/part/templates/part/bom-create.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{% extends 'create_edit_obj.html' %}
|
||||
|
||||
{% block obj_title %}
|
||||
Create a new BOM item
|
||||
{% endblock %}
|
15
InvenTree/part/templates/part/bom-delete.html
Normal file
15
InvenTree/part/templates/part/bom-delete.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends "delete_obj.html" %}
|
||||
|
||||
{% block del_title %}
|
||||
Are you sure you want to delete this BOM item?
|
||||
{% endblock %}
|
||||
|
||||
{% block del_body %}
|
||||
Deleting this entry will remove the BOM row from the following part:
|
||||
|
||||
<ul class='list-group'>
|
||||
<li class='list-group-item'>
|
||||
<b>{{ item.part.name }}</b> - <i>{{ item.part.description }}</i>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
18
InvenTree/part/templates/part/bom-detail.html
Normal file
18
InvenTree/part/templates/part/bom-detail.html
Normal file
@@ -0,0 +1,18 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h3>BOM Item</h3>
|
||||
<table class="table table-striped">
|
||||
<tr><td>Parent</td><td><a href="{% url 'part-detail' item.part.id %}">{{ item.part.name }}</a></td></tr>
|
||||
<tr><td>Child</td><td><a href="{% url 'part-detail' item.sub_part.id %}">{{ item.sub_part.name }}</a></td></tr>
|
||||
<tr><td>Quantity</td><td>{{ item.quantity }}</td></tr>
|
||||
</table>
|
||||
|
||||
<div class='container-fluid'>
|
||||
<a href="{% url 'bom-item-edit' item.id %}"><button class="btn btn-info">Edit BOM item</button></a>
|
||||
|
||||
<a href="{% url 'bom-item-delete' item.id %}"><button class="btn btn-danger">Delete BOM item</button></a>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
5
InvenTree/part/templates/part/bom-edit.html
Normal file
5
InvenTree/part/templates/part/bom-edit.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{% extends 'create_edit_obj.html' %}
|
||||
|
||||
{% block obj_title %}
|
||||
Edit details for BOM item
|
||||
{% endblock %}
|
@@ -21,4 +21,10 @@
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
<div class='container-fluid'>
|
||||
<a href="{% url 'bom-item-create' %}?parent={{ part.id }}">
|
||||
<button class='btn btn-success'>Add BOM Item</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@@ -13,7 +13,7 @@ This part is used to make the following parts:
|
||||
</tr>
|
||||
{% for item in part.used_in.all %}
|
||||
<tr>
|
||||
<td><a href="{% url 'part-detail' item.part.id %}">{{ item.part.name }}</a></td>
|
||||
<td><a href="{% url 'part-bom' item.part.id %}">{{ item.part.name }}</a></td>
|
||||
<td>{{ item.part.description }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user