mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-16 03:55:41 +00:00
Add pages for part tracking
- Edit / Delete / Create tracking info - Improvements to many pages
This commit is contained in:
@ -48,4 +48,5 @@ class EditStockItemForm(forms.ModelForm):
|
||||
'supplier_part',
|
||||
'location',
|
||||
'quantity',
|
||||
'status'
|
||||
]
|
@ -34,8 +34,13 @@ def before_delete_stock_location(sender, instance, using, **kwargs):
|
||||
|
||||
# Update each part in the stock location
|
||||
for item in instance.items.all():
|
||||
item.location = instance.parent
|
||||
item.save()
|
||||
# If this location has a parent, move the child stock items to the parent
|
||||
if instance.parent:
|
||||
item.location = instance.parent
|
||||
item.save()
|
||||
# No parent location? Delete the stock items
|
||||
else:
|
||||
item.delete()
|
||||
|
||||
# Update each child category
|
||||
for child in instance.children.all():
|
||||
|
@ -12,4 +12,10 @@
|
||||
{% include "stock/stock_table.html" with items=items %}
|
||||
{% endif %}
|
||||
|
||||
<div class='container-fluid'>
|
||||
<a href="{% url 'stock-location-create' %}">
|
||||
<button class="btn btn-success">New Stock Location</button>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -37,7 +37,7 @@
|
||||
{% endif %}
|
||||
<tr>
|
||||
<td>Status</td>
|
||||
<td>{{ item.status }}</td>
|
||||
<td>{{ item.get_status_display }}</td>
|
||||
</tr>
|
||||
{% if item.notes %}
|
||||
<tr>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<div class="navigation">
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item{% if location is None %} active" aria-current="page{% endif %}"><a href="/stock/">Parts</a></li>
|
||||
<li class="breadcrumb-item{% if location is None %} active" aria-current="page{% endif %}"><a href="/stock/">Stock</a></li>
|
||||
{% if location %}
|
||||
{% for path_item in location.parentpath %}
|
||||
<li class='breadcrumb-item'><a href="{% url 'stock-location-detail' path_item.id %}">{{ path_item.name }}</a></li>
|
||||
|
Reference in New Issue
Block a user