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:
@@ -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 %}
|
@@ -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 %}
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user