mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Added URL field to UniquePart
- e.g. link to external part tracking info page
This commit is contained in:
parent
eb5413b4fa
commit
f7eff8ae98
@ -4,10 +4,6 @@
|
||||
|
||||
{% include 'part/tabs.html' with tab='stock' %}
|
||||
|
||||
<br>
|
||||
Total in stock: {{ part.stock }}
|
||||
<br>
|
||||
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th>Link</th>
|
||||
|
@ -22,6 +22,7 @@ class EditTrackedPartForm(forms.ModelForm):
|
||||
fields = [
|
||||
'part',
|
||||
'serial',
|
||||
'URL',
|
||||
'customer',
|
||||
'status'
|
||||
]
|
||||
|
20
InvenTree/track/migrations/0005_uniquepart_url.py
Normal file
20
InvenTree/track/migrations/0005_uniquepart_url.py
Normal file
@ -0,0 +1,20 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11 on 2018-04-15 15:21
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('track', '0004_parttrackinginfo_user'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='uniquepart',
|
||||
name='URL',
|
||||
field=models.URLField(blank=True),
|
||||
),
|
||||
]
|
@ -28,6 +28,9 @@ class UniquePart(models.Model):
|
||||
|
||||
serial = models.PositiveIntegerField()
|
||||
|
||||
# Provide a URL for an external link
|
||||
URL = models.URLField(blank=True)
|
||||
|
||||
# createdBy = models.ForeignKey(User)
|
||||
|
||||
customer = models.ForeignKey(Customer, blank=True, null=True)
|
||||
|
@ -17,6 +17,12 @@
|
||||
<td>Creation Date</td>
|
||||
<td>{{ part.creation_date }}</td>
|
||||
</tr>
|
||||
{% if part.URL %}
|
||||
<tr>
|
||||
<td>URL</td>
|
||||
<td><a href="{{ part.URL }}">{{ part.URL }}</a></td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% if part.customer %}
|
||||
<tr>
|
||||
<td>Customer</td>
|
||||
@ -34,14 +40,8 @@
|
||||
<ul class='list-group'>
|
||||
{% for info in part.tracking_info.all %}
|
||||
<li class='list-group-item'>
|
||||
<div class='panel panel-default'>
|
||||
<div class='panel-heading'>
|
||||
{{ info.title }}<span class="badge">{{ info.date }}</span>
|
||||
</div>
|
||||
{% if info.notes %}
|
||||
<div class='panel-body'>{{ info.notes }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{{ info.title }}
|
||||
{% if info.note %}<br><i>{{ info.notes }}</i>{% endif %}<span class="badge">{{ info.date }}</span>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
Loading…
Reference in New Issue
Block a user