2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-09-15 15:11:34 +00:00

Add pages for part tracking

- Edit / Delete / Create tracking info
- Improvements to many pages
This commit is contained in:
Oliver
2018-04-16 00:30:57 +10:00
parent 55b533d3ef
commit 8e6de1b832
26 changed files with 302 additions and 58 deletions

View File

@@ -6,12 +6,12 @@
<div class="col-sm-6">
<h3>{{ supplier.name }}</h3>
<p>{{ supplier.description }}</p>
<p><a href="{% url 'supplier-edit' supplier.id %}">
<a href="{% url 'supplier-edit' supplier.id %}">
<button class="btn btn-info">Edit supplier details</button>
</a></p>
<p><a href="{% url 'supplier-delete' supplier.id %}">
</a>
<a href="{% url 'supplier-delete' supplier.id %}">
<button class="btn btn-danger">Delete supplier</button>
</a></p>
</a>
</div>
<div class="col-sm-6">
<table class="table">
@@ -71,5 +71,6 @@
<a href="{% url 'supplier-part-create' %}?supplier={{ supplier.id }}">
<button class="btn btn-success">New Supplier Part</button>
</a>
</div>
{% endblock %}

View File

@@ -29,12 +29,14 @@
<br>
<p><a href="{% url 'supplier-part-edit' part.id %}">
<div class='container-fluid'>
<a href="{% url 'supplier-part-edit' part.id %}">
<button class="btn btn-info">Edit supplier details</button>
</a></p>
<p><a href="{% url 'supplier-part-delete' part.id %}">
</a>
<a href="{% url 'supplier-part-delete' part.id %}">
<button class="btn btn-danger">Delete supplier part</button>
</a></p>
</a>
</div>
{% endblock %}

View File

@@ -5,6 +5,7 @@ from django.urls import reverse
from django.views.generic import DetailView, ListView
from django.views.generic.edit import UpdateView, DeleteView, CreateView
from part.models import Part
from .models import Supplier, SupplierPart
from .forms import EditSupplierForm
@@ -76,9 +77,16 @@ class SupplierPartCreate(CreateView):
initials = super(SupplierPartCreate, self).get_initial().copy()
supplier_id = self.request.GET.get('supplier', None)
part_id = self.request.GET.get('part', None)
if supplier_id:
initials['supplier'] = get_object_or_404(Supplier, pk=supplier_id)
# TODO
# self.fields['supplier'].disabled = True
if part_id:
initials['part'] = get_object_or_404(Part, pk=part_id)
# TODO
# self.fields['part'].disabled = True
return initials