mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 12:35:46 +00:00
List purchase orders for a given part
This commit is contained in:
19
InvenTree/order/migrations/0007_auto_20190605_2138.py
Normal file
19
InvenTree/order/migrations/0007_auto_20190605_2138.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2 on 2019-06-05 11:38
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('order', '0006_auto_20190605_2056'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='purchaseorderlineitem',
|
||||
name='part',
|
||||
field=models.ForeignKey(blank=True, help_text='Supplier part', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='order_line_items', to='company.SupplierPart'),
|
||||
),
|
||||
]
|
19
InvenTree/order/migrations/0008_auto_20190605_2140.py
Normal file
19
InvenTree/order/migrations/0008_auto_20190605_2140.py
Normal file
@ -0,0 +1,19 @@
|
||||
# Generated by Django 2.2 on 2019-06-05 11:40
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('order', '0007_auto_20190605_2138'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='purchaseorderlineitem',
|
||||
name='part',
|
||||
field=models.ForeignKey(blank=True, help_text='Supplier part', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='purchase_order_line_items', to='company.SupplierPart'),
|
||||
),
|
||||
]
|
@ -124,7 +124,7 @@ class PurchaseOrderLineItem(OrderLineItem):
|
||||
part = models.ForeignKey(
|
||||
SupplierPart, on_delete=models.SET_NULL,
|
||||
blank=True, null=True,
|
||||
related_name='orders',
|
||||
related_name='purchase_order_line_items',
|
||||
help_text=_("Supplier part"),
|
||||
)
|
||||
|
||||
|
16
InvenTree/order/templates/order/po_table.html
Normal file
16
InvenTree/order/templates/order/po_table.html
Normal file
@ -0,0 +1,16 @@
|
||||
<table class='table table-striped table-condensed' id='po-table'>
|
||||
<tr>
|
||||
<th data-field='company'>Company</th>
|
||||
<th data-field='reference'>Order Reference</th>
|
||||
<th data-field='description'>Description</th>
|
||||
<th data-field='status'>Status</th>
|
||||
</tr>
|
||||
{% for order in orders %}
|
||||
<tr>
|
||||
<td>{% include "hover_image.html" with image=order.supplier.image hover=True %}<a href="{{ order.supplier.get_absolute_url }}">{{ order.supplier.name }}</a></td>
|
||||
<td><a href="{% url 'purchase-order-detail' order.id %}">{{ order }}</a></td>
|
||||
<td>{{ order.description }}</td>
|
||||
<td>{% include "order/order_status.html" %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
@ -10,22 +10,6 @@ InvenTree | Purchase Orders
|
||||
|
||||
<h4>Purchase Orders</h4>
|
||||
|
||||
|
||||
<table class='table table-striped table-condensed' id='po-table'>
|
||||
<tr>
|
||||
<th>Company</th>
|
||||
<th>Order Reference</th>
|
||||
<th>Description</th>
|
||||
<th>Status</th>
|
||||
</tr>
|
||||
{% for order in orders %}
|
||||
<tr>
|
||||
<td>{% include "hover_image.html" with image=order.supplier.image hover=True %}<a href="{{ order.supplier.get_absolute_url }}">{{ order.supplier.name }}</a></td>
|
||||
<td><a href="{% url 'purchase-order-detail' order.id %}">{{ order }}</a></td>
|
||||
<td>{{ order.description }}</td>
|
||||
<td>{% include "order/order_status.html" %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% include "order/po_table.html" %}
|
||||
|
||||
{% endblock %}
|
Reference in New Issue
Block a user