Rename Order.URL to Order.link

This commit is contained in:
Oliver Walters 2020-04-06 11:56:52 +10:00
parent a306ad0bc3
commit 87a09a7220
5 changed files with 33 additions and 6 deletions

View File

@ -70,7 +70,7 @@ class EditPurchaseOrderForm(HelperForm):
'reference',
'supplier',
'description',
'URL',
'link',
]

View File

@ -0,0 +1,18 @@
# Generated by Django 2.2.10 on 2020-04-06 01:51
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('order', '0017_auto_20200331_1000'),
]
operations = [
migrations.RenameField(
model_name='purchaseorder',
old_name='URL',
new_name='link',
),
]

View File

@ -69,7 +69,7 @@ class Order(models.Model):
description = models.CharField(max_length=250, help_text=_('Order description'))
URL = models.URLField(blank=True, help_text=_('Link to external page'))
link = models.URLField(blank=True, help_text=_('Link to external page'))
creation_date = models.DateField(blank=True, null=True)

View File

@ -21,7 +21,7 @@ class POSerializer(InvenTreeModelSerializer):
'supplier',
'reference',
'description',
'URL',
'link',
'status',
'notes',
]

View File

@ -25,9 +25,6 @@ InvenTree | {{ order }}
<div class='media-body'>
<h4>{{ order }}</h4>
<p>{{ order.description }}</p>
{% if order.URL %}
<a href="{{ order.URL }}">{{ order.URL }}</a>
{% endif %}
<p>
<div class='btn-row'>
<div class='btn-group'>
@ -64,25 +61,37 @@ InvenTree | {{ order }}
<h4>{% trans "Purchase Order Details" %}</h4>
<table class='table'>
<tr>
<td><span class='fas fa-industry'></span></td>
<td>{% trans "Supplier" %}</td>
<td><a href="{% url 'company-detail' order.supplier.id %}">{{ order.supplier }}</a></td>
</tr>
<tr>
<td><span class='fas fa-info'></span></td>
<td>{% trans "Status" %}</td>
<td>{% include "order/order_status.html" %}</td>
</tr>
{% if order.link %}
<tr>
<td><span class='fas fa-link'></span></td>
<td>External Link</td>
<td><a href="{{ order.link }}">{{ order.link }}</a></td>
</tr>
{% endif %}
<tr>
<td><span class='fas fa-calendar-alt'></span></td>
<td>{% trans "Created" %}</td>
<td>{{ order.creation_date }}<span class='badge'>{{ order.created_by }}</span></td>
</tr>
{% if order.issue_date %}
<tr>
<td><span class='fas fa-calendar-alt'></span></td>
<td>{% trans "Issued" %}</td>
<td>{{ order.issue_date }}</td>
</tr>
{% endif %}
{% if order.status == OrderStatus.COMPLETE %}
<tr>
<td><span class='fas fa-calendar-alt'></span></td>
<td>{% trans "Received" %}</td>
<td>{{ order.complete_date }}<span class='badge'>{{ order.received_by }}</span></td>
</tr>