Rename Build.URL -> Build.link

This commit is contained in:
Oliver Walters 2020-04-06 11:28:35 +10:00
parent bbe714c8f7
commit 789712acbe
7 changed files with 51 additions and 12 deletions

View File

@ -9,6 +9,7 @@
notes: 'Some simple notes'
status: 10 # PENDING
creation_date: '2019-03-16'
link: http://www.google.com
- model: build.build
fields:

View File

@ -25,7 +25,7 @@ class EditBuildForm(HelperForm):
'quantity',
'take_from',
'batch',
'URL',
'link',
]

View File

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

View File

@ -38,7 +38,7 @@ class Build(models.Model):
batch: Batch code transferred to build parts (optional)
creation_date: Date the build was created (auto)
completion_date: Date the build was completed
URL: External URL for extra information
link: External URL for extra information
notes: Text notes
"""
@ -94,7 +94,7 @@ class Build(models.Model):
related_name='builds_completed'
)
URL = InvenTreeURLField(blank=True, help_text=_('Link to external URL'))
link = InvenTreeURLField(blank=True, help_text=_('Link to external URL'))
notes = MarkdownxField(blank=True, help_text=_('Extra build notes'))

View File

@ -30,7 +30,9 @@ class BuildSerializer(InvenTreeModelSerializer):
'quantity',
'status',
'status_text',
'notes']
'notes',
'link',
]
read_only_fields = [
'status',

View File

@ -11,15 +11,21 @@
<table class='table table-striped'>
<tr>
<td>{% trans "Title" %}</td><td>{{ build.title }}</td>
<td></td>
<td>{% trans "Title" %}</td>
<td>{{ build.title }}</td>
</tr>
<tr>
<td>{% trans "Part" %}</td><td><a href="{% url 'part-build' build.part.id %}">{{ build.part.full_name }}</a></td>
<td><span class='fas fa-shapes'></span></td>
<td>{% trans "Part" %}</td>
<td><a href="{% url 'part-build' build.part.id %}">{{ build.part.full_name }}</a></td>
</tr>
<tr>
<td></td>
<td>{% trans "Quantity" %}</td><td>{{ build.quantity }}</td>
</tr>
<tr>
<td><span class='fas fa-map-marker-alt'></span></td>
<td>{% trans "Stock Source" %}</td>
<td>
{% if build.take_from %}
@ -30,23 +36,32 @@
</td>
</tr>
<tr>
<td>{% trans "Status" %}</td><td>{% include "build_status.html" with build=build %}</td>
<td><span class='fas fa-info'></span></td>
<td>{% trans "Status" %}</td>
<td>{% include "build_status.html" with build=build %}</td>
</tr>
{% if build.batch %}
<tr>
<td>{% trans "Batch" %}</td><td>{{ build.batch }}</td>
<td></td>
<td>{% trans "Batch" %}</td>
<td>{{ build.batch }}</td>
</tr>
{% endif %}
{% if build.URL %}
{% if build.link %}
<tr>
<td>{% trans "URL" %}</td><td><a href="{{ build.URL }}">{{ build.URL }}</a></td>
<td><span class='fas fa-link'></span></td>
<td>{% trans "External Link" %}</td>
<td><a href="{{ build.link }}">{{ build.link }}</a></td>
</tr>
{% endif %}
<tr>
<td>{% trans "Created" %}</td><td>{{ build.creation_date }}</td>
<td><span class='fas fa-calendar-alt'></span></td>
<td>{% trans "Created" %}</td>
<td>{{ build.creation_date }}</td>
</tr>
{% if build.is_active %}
<tr>
<td></td>
<td>{% trans "Enough Parts?" %}</td>
<td>
{% if build.can_build %}
@ -59,7 +74,9 @@
{% endif %}
{% if build.completion_date %}
<tr>
<td>{% trans "Completed" %}</td><td>{{ build.completion_date }}{% if build.completed_by %}<span class='badge'>{{ build.completed_by }}</span>{% endif %}</td>
<td><span class='fas fa-calendar-alt'></span></td>
<td>{% trans "Completed" %}</td>
<td>{{ build.completion_date }}{% if build.completed_by %}<span class='badge'>{{ build.completed_by }}</span>{% endif %}</td>
</tr>
{% endif %}
</table>

View File

@ -6,6 +6,7 @@
name: 'M2x4 LPHS'
description: 'M2x4 low profile head screw'
category: 8
link: www.acme.com/parts/m2x4lphs
- model: part.part
pk: 2