2
0
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:
Oliver
2018-04-15 21:29:24 +10:00
parent 0632609a80
commit 5861296974
10 changed files with 136 additions and 5 deletions

View File

@@ -0,0 +1,5 @@
{% extends 'create_edit_obj.html' %}
{% block obj_title %}
Create a new BOM item
{% endblock %}

View 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 %}

View 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 %}

View File

@@ -0,0 +1,5 @@
{% extends 'create_edit_obj.html' %}
{% block obj_title %}
Edit details for BOM item
{% endblock %}

View File

@@ -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 %}

View File

@@ -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 %}