mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Merge pull request #698 from SchrodingersGat/stock-api
Further API work
This commit is contained in:
commit
7c2af32b38
1
.gitignore
vendored
1
.gitignore
vendored
@ -6,6 +6,7 @@ __pycache__/
|
|||||||
# Distribution / packaging
|
# Distribution / packaging
|
||||||
.Python
|
.Python
|
||||||
env/
|
env/
|
||||||
|
inventree-env/
|
||||||
./build/
|
./build/
|
||||||
develop-eggs/
|
develop-eggs/
|
||||||
dist/
|
dist/
|
||||||
|
@ -378,8 +378,8 @@ function loadStockTrackingTable(table, options) {
|
|||||||
html += "<br><i>" + row.notes + "</i>";
|
html += "<br><i>" + row.notes + "</i>";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (row.URL) {
|
if (row.link) {
|
||||||
html += "<br><a href='" + row.URL + "'>" + row.URL + "</a>";
|
html += "<br><a href='" + row.link + "'>" + row.link + "</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
notes: 'Some simple notes'
|
notes: 'Some simple notes'
|
||||||
status: 10 # PENDING
|
status: 10 # PENDING
|
||||||
creation_date: '2019-03-16'
|
creation_date: '2019-03-16'
|
||||||
|
link: http://www.google.com
|
||||||
|
|
||||||
- model: build.build
|
- model: build.build
|
||||||
fields:
|
fields:
|
||||||
|
@ -25,7 +25,7 @@ class EditBuildForm(HelperForm):
|
|||||||
'quantity',
|
'quantity',
|
||||||
'take_from',
|
'take_from',
|
||||||
'batch',
|
'batch',
|
||||||
'URL',
|
'link',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
18
InvenTree/build/migrations/0011_auto_20200406_0123.py
Normal file
18
InvenTree/build/migrations/0011_auto_20200406_0123.py
Normal 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',
|
||||||
|
),
|
||||||
|
]
|
@ -38,7 +38,7 @@ class Build(models.Model):
|
|||||||
batch: Batch code transferred to build parts (optional)
|
batch: Batch code transferred to build parts (optional)
|
||||||
creation_date: Date the build was created (auto)
|
creation_date: Date the build was created (auto)
|
||||||
completion_date: Date the build was completed
|
completion_date: Date the build was completed
|
||||||
URL: External URL for extra information
|
link: External URL for extra information
|
||||||
notes: Text notes
|
notes: Text notes
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ class Build(models.Model):
|
|||||||
related_name='builds_completed'
|
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'))
|
notes = MarkdownxField(blank=True, help_text=_('Extra build notes'))
|
||||||
|
|
||||||
|
@ -30,7 +30,9 @@ class BuildSerializer(InvenTreeModelSerializer):
|
|||||||
'quantity',
|
'quantity',
|
||||||
'status',
|
'status',
|
||||||
'status_text',
|
'status_text',
|
||||||
'notes']
|
'notes',
|
||||||
|
'link',
|
||||||
|
]
|
||||||
|
|
||||||
read_only_fields = [
|
read_only_fields = [
|
||||||
'status',
|
'status',
|
||||||
|
@ -11,15 +11,21 @@
|
|||||||
|
|
||||||
<table class='table table-striped'>
|
<table class='table table-striped'>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "Title" %}</td><td>{{ build.title }}</td>
|
<td></td>
|
||||||
|
<td>{% trans "Title" %}</td>
|
||||||
|
<td>{{ build.title }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>{% trans "Quantity" %}</td><td>{{ build.quantity }}</td>
|
<td>{% trans "Quantity" %}</td><td>{{ build.quantity }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-map-marker-alt'></span></td>
|
||||||
<td>{% trans "Stock Source" %}</td>
|
<td>{% trans "Stock Source" %}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if build.take_from %}
|
{% if build.take_from %}
|
||||||
@ -30,23 +36,32 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
</tr>
|
||||||
{% if build.batch %}
|
{% if build.batch %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "Batch" %}</td><td>{{ build.batch }}</td>
|
<td></td>
|
||||||
|
<td>{% trans "Batch" %}</td>
|
||||||
|
<td>{{ build.batch }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if build.URL %}
|
{% if build.link %}
|
||||||
<tr>
|
<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>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<tr>
|
<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>
|
</tr>
|
||||||
{% if build.is_active %}
|
{% if build.is_active %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>{% trans "Enough Parts?" %}</td>
|
<td>{% trans "Enough Parts?" %}</td>
|
||||||
<td>
|
<td>
|
||||||
{% if build.can_build %}
|
{% if build.can_build %}
|
||||||
@ -59,7 +74,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% if build.completion_date %}
|
{% if build.completion_date %}
|
||||||
<tr>
|
<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>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
@ -53,7 +53,7 @@ class EditSupplierPartForm(HelperForm):
|
|||||||
'description',
|
'description',
|
||||||
'manufacturer',
|
'manufacturer',
|
||||||
'MPN',
|
'MPN',
|
||||||
'URL',
|
'link',
|
||||||
'note',
|
'note',
|
||||||
'base_cost',
|
'base_cost',
|
||||||
'multiple',
|
'multiple',
|
||||||
|
23
InvenTree/company/migrations/0013_auto_20200406_0131.py
Normal file
23
InvenTree/company/migrations/0013_auto_20200406_0131.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 2.2.10 on 2020-04-06 01:31
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('company', '0012_auto_20200318_1114'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='company',
|
||||||
|
old_name='URL',
|
||||||
|
new_name='link',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='supplierpart',
|
||||||
|
old_name='URL',
|
||||||
|
new_name='link',
|
||||||
|
),
|
||||||
|
]
|
@ -63,7 +63,7 @@ class Company(models.Model):
|
|||||||
address: Postal address
|
address: Postal address
|
||||||
phone: contact phone number
|
phone: contact phone number
|
||||||
email: contact email address
|
email: contact email address
|
||||||
URL: Secondary URL e.g. for link to internal Wiki page
|
link: Secondary URL e.g. for link to internal Wiki page
|
||||||
image: Company image / logo
|
image: Company image / logo
|
||||||
notes: Extra notes about the company
|
notes: Extra notes about the company
|
||||||
is_customer: boolean value, is this company a customer
|
is_customer: boolean value, is this company a customer
|
||||||
@ -88,7 +88,7 @@ class Company(models.Model):
|
|||||||
contact = models.CharField(max_length=100,
|
contact = models.CharField(max_length=100,
|
||||||
blank=True, help_text=_('Point of contact'))
|
blank=True, help_text=_('Point of contact'))
|
||||||
|
|
||||||
URL = InvenTreeURLField(blank=True, help_text=_('Link to external company information'))
|
link = InvenTreeURLField(blank=True, help_text=_('Link to external company information'))
|
||||||
|
|
||||||
image = models.ImageField(upload_to=rename_company_image, max_length=255, null=True, blank=True)
|
image = models.ImageField(upload_to=rename_company_image, max_length=255, null=True, blank=True)
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ class SupplierPart(models.Model):
|
|||||||
SKU: Stock keeping unit (supplier part number)
|
SKU: Stock keeping unit (supplier part number)
|
||||||
manufacturer: Manufacturer name
|
manufacturer: Manufacturer name
|
||||||
MPN: Manufacture part number
|
MPN: Manufacture part number
|
||||||
URL: Link to external website for this part
|
link: Link to external website for this part
|
||||||
description: Descriptive notes field
|
description: Descriptive notes field
|
||||||
note: Longer form note field
|
note: Longer form note field
|
||||||
base_cost: Base charge added to order independent of quantity e.g. "Reeling Fee"
|
base_cost: Base charge added to order independent of quantity e.g. "Reeling Fee"
|
||||||
@ -241,7 +241,7 @@ class SupplierPart(models.Model):
|
|||||||
|
|
||||||
MPN = models.CharField(max_length=100, blank=True, help_text=_('Manufacturer part number'))
|
MPN = models.CharField(max_length=100, blank=True, help_text=_('Manufacturer part number'))
|
||||||
|
|
||||||
URL = InvenTreeURLField(blank=True, help_text=_('URL for external supplier part link'))
|
link = InvenTreeURLField(blank=True, help_text=_('URL for external supplier part link'))
|
||||||
|
|
||||||
description = models.CharField(max_length=250, blank=True, help_text=_('Supplier part description'))
|
description = models.CharField(max_length=250, blank=True, help_text=_('Supplier part description'))
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ class CompanySerializer(InvenTreeModelSerializer):
|
|||||||
'address',
|
'address',
|
||||||
'email',
|
'email',
|
||||||
'contact',
|
'contact',
|
||||||
'URL',
|
'link',
|
||||||
'image',
|
'image',
|
||||||
'notes',
|
'notes',
|
||||||
'is_customer',
|
'is_customer',
|
||||||
@ -91,7 +91,7 @@ class SupplierPartSerializer(InvenTreeModelSerializer):
|
|||||||
'manufacturer',
|
'manufacturer',
|
||||||
'description',
|
'description',
|
||||||
'MPN',
|
'MPN',
|
||||||
'URL',
|
'link',
|
||||||
'pricing',
|
'pricing',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -45,27 +45,37 @@ InvenTree | {% trans "Company" %} - {{ company.name }}
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
{% if company.website %}
|
{% if company.website %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "Website" %}</td><td><a href="{{ company.website }}">{{ company.website }}</a></td>
|
<td><span class='fas fa-link'></span></td>
|
||||||
|
<td>{% trans "Website" %}</td>
|
||||||
|
<td><a href="{{ company.website }}">{{ company.website }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if company.address %}
|
{% if company.address %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "Address" %}</td><td>{{ company.address }}</td>
|
<td><span class='fas fa-map-marked-alt'></span></td>
|
||||||
|
<td>{% trans "Address" %}</td>
|
||||||
|
<td>{{ company.address }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if company.phone %}
|
{% if company.phone %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "Phone" %}</td><td>{{ company.phone }}</td>
|
<td><span class='fas fa-phone'></span></td>
|
||||||
|
<td>{% trans "Phone" %}</td>
|
||||||
|
<td>{{ company.phone }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if company.email %}
|
{% if company.email %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "Email" %}</td><td>{{ company.email }}</td>
|
<td><span class='fas fa-at'></span></td>
|
||||||
|
<td>{% trans "Email" %}</td>
|
||||||
|
<td>{{ company.email }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if company.contact %}
|
{% if company.contact %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "Contact" %}</td><td>{{ company.contact }}</td>
|
<td><span class='fas fa-user'></span></td>
|
||||||
|
<td>{% trans "Contact" %}</td>
|
||||||
|
<td>{{ company.contact }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
@ -86,8 +86,8 @@
|
|||||||
title: 'MPN',
|
title: 'MPN',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'URL',
|
field: 'link',
|
||||||
title: '{% trans "URL" %}',
|
title: '{% trans "Link" %}',
|
||||||
formatter: function(value, row, index, field) {
|
formatter: function(value, row, index, field) {
|
||||||
if (value) {
|
if (value) {
|
||||||
return renderLink(value, value);
|
return renderLink(value, value);
|
||||||
|
@ -43,8 +43,8 @@ InvenTree | {% trans "Supplier Part" %}
|
|||||||
</tr>
|
</tr>
|
||||||
<tr><td>{% trans "Supplier" %}</td><td><a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
|
<tr><td>{% trans "Supplier" %}</td><td><a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
|
||||||
<tr><td>{% trans "SKU" %}</td><td>{{ part.SKU }}</tr></tr>
|
<tr><td>{% trans "SKU" %}</td><td>{{ part.SKU }}</tr></tr>
|
||||||
{% if part.URL %}
|
{% if part.link %}
|
||||||
<tr><td>{% trans "URL" %}</td><td><a href="{{ part.URL }}">{{ part.URL }}</a></td></tr>
|
<tr><td>{% trans "External Link" %}</td><td><a href="{{ part.link }}">{{ part.link }}</a></td></tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if part.description %}
|
{% if part.description %}
|
||||||
<tr><td>{% trans "Description" %}</td><td>{{ part.description }}</td></tr>
|
<tr><td>{% trans "Description" %}</td><td>{{ part.description }}</td></tr>
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr><td>{% trans "Supplier" %}</td><td><a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
|
<tr><td>{% trans "Supplier" %}</td><td><a href="{% url 'company-detail-parts' part.supplier.id %}">{{ part.supplier.name }}</a></td></tr>
|
||||||
<tr><td>{% trans "SKU" %}</td><td>{{ part.SKU }}</tr></tr>
|
<tr><td>{% trans "SKU" %}</td><td>{{ part.SKU }}</tr></tr>
|
||||||
{% if part.URL %}
|
{% if part.link %}
|
||||||
<tr><td>{% trans "URL" %}</td><td><a href="{{ part.URL }}">{{ part.URL }}</a></td></tr>
|
<tr><td>{% trans "External Link" %}</td><td><a href="{{ part.link }}">{{ part.link }}</a></td></tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if part.description %}
|
{% if part.description %}
|
||||||
<tr><td>{% trans "Description" %}</td><td>{{ part.description }}</td></tr>
|
<tr><td>{% trans "Description" %}</td><td>{{ part.description }}</td></tr>
|
||||||
|
@ -78,7 +78,7 @@ class POList(generics.ListCreateAPIView):
|
|||||||
'supplier__image',
|
'supplier__image',
|
||||||
'reference',
|
'reference',
|
||||||
'description',
|
'description',
|
||||||
'URL',
|
'link',
|
||||||
'status',
|
'status',
|
||||||
'notes',
|
'notes',
|
||||||
'creation_date',
|
'creation_date',
|
||||||
|
@ -70,7 +70,7 @@ class EditPurchaseOrderForm(HelperForm):
|
|||||||
'reference',
|
'reference',
|
||||||
'supplier',
|
'supplier',
|
||||||
'description',
|
'description',
|
||||||
'URL',
|
'link',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
18
InvenTree/order/migrations/0018_auto_20200406_0151.py
Normal file
18
InvenTree/order/migrations/0018_auto_20200406_0151.py
Normal 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',
|
||||||
|
),
|
||||||
|
]
|
@ -69,7 +69,7 @@ class Order(models.Model):
|
|||||||
|
|
||||||
description = models.CharField(max_length=250, help_text=_('Order description'))
|
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)
|
creation_date = models.DateField(blank=True, null=True)
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ class POSerializer(InvenTreeModelSerializer):
|
|||||||
'supplier',
|
'supplier',
|
||||||
'reference',
|
'reference',
|
||||||
'description',
|
'description',
|
||||||
'URL',
|
'link',
|
||||||
'status',
|
'status',
|
||||||
'notes',
|
'notes',
|
||||||
]
|
]
|
||||||
|
@ -25,9 +25,6 @@ InvenTree | {{ order }}
|
|||||||
<div class='media-body'>
|
<div class='media-body'>
|
||||||
<h4>{{ order }}</h4>
|
<h4>{{ order }}</h4>
|
||||||
<p>{{ order.description }}</p>
|
<p>{{ order.description }}</p>
|
||||||
{% if order.URL %}
|
|
||||||
<a href="{{ order.URL }}">{{ order.URL }}</a>
|
|
||||||
{% endif %}
|
|
||||||
<p>
|
<p>
|
||||||
<div class='btn-row'>
|
<div class='btn-row'>
|
||||||
<div class='btn-group'>
|
<div class='btn-group'>
|
||||||
@ -64,25 +61,37 @@ InvenTree | {{ order }}
|
|||||||
<h4>{% trans "Purchase Order Details" %}</h4>
|
<h4>{% trans "Purchase Order Details" %}</h4>
|
||||||
<table class='table'>
|
<table class='table'>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-industry'></span></td>
|
||||||
<td>{% trans "Supplier" %}</td>
|
<td>{% trans "Supplier" %}</td>
|
||||||
<td><a href="{% url 'company-detail' order.supplier.id %}">{{ order.supplier }}</a></td>
|
<td><a href="{% url 'company-detail' order.supplier.id %}">{{ order.supplier }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-info'></span></td>
|
||||||
<td>{% trans "Status" %}</td>
|
<td>{% trans "Status" %}</td>
|
||||||
<td>{% include "order/order_status.html" %}</td>
|
<td>{% include "order/order_status.html" %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{% if order.link %}
|
||||||
<tr>
|
<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>{% trans "Created" %}</td>
|
||||||
<td>{{ order.creation_date }}<span class='badge'>{{ order.created_by }}</span></td>
|
<td>{{ order.creation_date }}<span class='badge'>{{ order.created_by }}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if order.issue_date %}
|
{% if order.issue_date %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Issued" %}</td>
|
<td>{% trans "Issued" %}</td>
|
||||||
<td>{{ order.issue_date }}</td>
|
<td>{{ order.issue_date }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if order.status == OrderStatus.COMPLETE %}
|
{% if order.status == OrderStatus.COMPLETE %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Received" %}</td>
|
<td>{% trans "Received" %}</td>
|
||||||
<td>{{ order.complete_date }}<span class='badge'>{{ order.received_by }}</span></td>
|
<td>{{ order.complete_date }}<span class='badge'>{{ order.received_by }}</span></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -200,7 +200,7 @@ class PartList(generics.ListCreateAPIView):
|
|||||||
'description',
|
'description',
|
||||||
'keywords',
|
'keywords',
|
||||||
'is_template',
|
'is_template',
|
||||||
'URL',
|
'link',
|
||||||
'units',
|
'units',
|
||||||
'minimum_stock',
|
'minimum_stock',
|
||||||
'trackable',
|
'trackable',
|
||||||
@ -249,12 +249,6 @@ class PartList(generics.ListCreateAPIView):
|
|||||||
else:
|
else:
|
||||||
item['category__name'] = None
|
item['category__name'] = None
|
||||||
|
|
||||||
# Rename "URL" to "link" to distinguish from lower-case "url",
|
|
||||||
# which is the web address of the item itself
|
|
||||||
if 'URL' in item.keys():
|
|
||||||
item['link'] = item['URL']
|
|
||||||
del item['URL']
|
|
||||||
|
|
||||||
return Response(data)
|
return Response(data)
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
name: 'M2x4 LPHS'
|
name: 'M2x4 LPHS'
|
||||||
description: 'M2x4 low profile head screw'
|
description: 'M2x4 low profile head screw'
|
||||||
category: 8
|
category: 8
|
||||||
|
link: www.acme.com/parts/m2x4lphs
|
||||||
|
|
||||||
- model: part.part
|
- model: part.part
|
||||||
pk: 2
|
pk: 2
|
||||||
|
@ -120,7 +120,7 @@ class EditPartForm(HelperForm):
|
|||||||
'keywords',
|
'keywords',
|
||||||
'variant_of',
|
'variant_of',
|
||||||
'is_template',
|
'is_template',
|
||||||
'URL',
|
'link',
|
||||||
'default_location',
|
'default_location',
|
||||||
'default_supplier',
|
'default_supplier',
|
||||||
'units',
|
'units',
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Generated by Django 2.2.10 on 2020-04-04 12:38
|
# Generated by Django 2.2.10 on 2020-04-04 12:38
|
||||||
|
|
||||||
from django.db import migrations
|
from django.db import migrations
|
||||||
|
from django.db.utils import OperationalError
|
||||||
|
|
||||||
from part.models import Part
|
from part.models import Part
|
||||||
from stdimage.utils import render_variations
|
from stdimage.utils import render_variations
|
||||||
@ -11,11 +12,13 @@ def create_thumbnails(apps, schema_editor):
|
|||||||
Create thumbnails for all existing Part images.
|
Create thumbnails for all existing Part images.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
for part in Part.objects.all():
|
try:
|
||||||
# Render thumbnail for each existing Part
|
for part in Part.objects.all():
|
||||||
if part.image:
|
# Render thumbnail for each existing Part
|
||||||
part.image.render_variations()
|
if part.image:
|
||||||
|
part.image.render_variations()
|
||||||
|
except OperationalError:
|
||||||
|
print("Error - could not generate Part thumbnails")
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
18
InvenTree/part/migrations/0035_auto_20200406_0045.py
Normal file
18
InvenTree/part/migrations/0035_auto_20200406_0045.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 2.2.10 on 2020-04-06 00:45
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('part', '0034_auto_20200404_1238'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='part',
|
||||||
|
old_name='URL',
|
||||||
|
new_name='link',
|
||||||
|
),
|
||||||
|
]
|
@ -214,7 +214,7 @@ class Part(models.Model):
|
|||||||
IPN: Internal part number (optional)
|
IPN: Internal part number (optional)
|
||||||
revision: Part revision
|
revision: Part revision
|
||||||
is_template: If True, this part is a 'template' part and cannot be instantiated as a StockItem
|
is_template: If True, this part is a 'template' part and cannot be instantiated as a StockItem
|
||||||
URL: Link to an external page with more information about this part (e.g. internal Wiki)
|
link: Link to an external page with more information about this part (e.g. internal Wiki)
|
||||||
image: Image of this part
|
image: Image of this part
|
||||||
default_location: Where the item is normally stored (may be null)
|
default_location: Where the item is normally stored (may be null)
|
||||||
default_supplier: The default SupplierPart which should be used to procure and stock this part
|
default_supplier: The default SupplierPart which should be used to procure and stock this part
|
||||||
@ -383,7 +383,7 @@ class Part(models.Model):
|
|||||||
|
|
||||||
revision = models.CharField(max_length=100, blank=True, help_text=_('Part revision or version number'))
|
revision = models.CharField(max_length=100, blank=True, help_text=_('Part revision or version number'))
|
||||||
|
|
||||||
URL = InvenTreeURLField(blank=True, help_text=_('Link to extenal URL'))
|
link = InvenTreeURLField(blank=True, help_text=_('Link to extenal URL'))
|
||||||
|
|
||||||
image = StdImageField(
|
image = StdImageField(
|
||||||
upload_to=rename_part_image,
|
upload_to=rename_part_image,
|
||||||
|
@ -47,7 +47,7 @@ class PartBriefSerializer(InvenTreeModelSerializer):
|
|||||||
""" Serializer for Part (brief detail) """
|
""" Serializer for Part (brief detail) """
|
||||||
|
|
||||||
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
||||||
image_url = serializers.CharField(source='get_thumbnail_url', read_only=True)
|
thumbnail = serializers.CharField(source='get_thumbnail_url', read_only=True)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def setup_eager_loading(queryset):
|
def setup_eager_loading(queryset):
|
||||||
@ -66,7 +66,7 @@ class PartBriefSerializer(InvenTreeModelSerializer):
|
|||||||
'description',
|
'description',
|
||||||
'total_stock',
|
'total_stock',
|
||||||
'available_stock',
|
'available_stock',
|
||||||
'image_url',
|
'thumbnail',
|
||||||
'active',
|
'active',
|
||||||
'assembly',
|
'assembly',
|
||||||
'virtual',
|
'virtual',
|
||||||
@ -86,7 +86,6 @@ class PartSerializer(InvenTreeModelSerializer):
|
|||||||
on_order = serializers.FloatField(read_only=True)
|
on_order = serializers.FloatField(read_only=True)
|
||||||
thumbnail = serializers.CharField(source='get_thumbnail_url', read_only=True)
|
thumbnail = serializers.CharField(source='get_thumbnail_url', read_only=True)
|
||||||
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
url = serializers.CharField(source='get_absolute_url', read_only=True)
|
||||||
link = serializers.CharField(source='URL')
|
|
||||||
used_in = serializers.IntegerField(source='used_in_count', read_only=True)
|
used_in = serializers.IntegerField(source='used_in_count', read_only=True)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
@ -60,11 +60,11 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% if part.URL %}
|
{% if part.link %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><span class='fas fa-link'></span></td>
|
<td><span class='fas fa-link'></span></td>
|
||||||
<td><b>{% trans "Link" %}</b></td>
|
<td><b>{% trans "External Link" %}</b></td>
|
||||||
<td><a href="{{ part.URL }}">{{ part.URL }}</a></td>
|
<td><a href="{{ part.link }}">{{ part.link }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if part.default_location %}
|
{% if part.default_location %}
|
||||||
|
@ -72,14 +72,16 @@
|
|||||||
<table class='table table-condensed'>
|
<table class='table table-condensed'>
|
||||||
{% if part.IPN %}
|
{% if part.IPN %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>{% trans "IPN" %}</td>
|
<td>{% trans "IPN" %}</td>
|
||||||
<td>{{ part.IPN }}</td>
|
<td>{{ part.IPN }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if part.URL %}
|
{% if part.link %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "URL" %}</td>
|
<td><span class='fas fa-link'></span></td>
|
||||||
<td><a href="{{ part.URL }}">{{ part.URL }}</a></td>
|
<td>{% trans "External Link" %}</td>
|
||||||
|
<td><a href="{{ part.link }}">{{ part.link }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -1388,8 +1388,6 @@ class BomExport(AjaxView):
|
|||||||
url += '?file_format=' + fmt
|
url += '?file_format=' + fmt
|
||||||
url += '&cascade=' + str(cascade)
|
url += '&cascade=' + str(cascade)
|
||||||
|
|
||||||
print("URL:", url)
|
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
'form_valid': part is not None,
|
'form_valid': part is not None,
|
||||||
'url': url,
|
'url': url,
|
||||||
|
@ -59,6 +59,22 @@ class StockDetail(generics.RetrieveUpdateDestroyAPIView):
|
|||||||
serializer_class = StockItemSerializer
|
serializer_class = StockItemSerializer
|
||||||
permission_classes = (permissions.IsAuthenticated,)
|
permission_classes = (permissions.IsAuthenticated,)
|
||||||
|
|
||||||
|
def get_serializer(self, *args, **kwargs):
|
||||||
|
|
||||||
|
try:
|
||||||
|
kwargs['part_detail'] = str2bool(self.request.GET.get('part_detail', False))
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
try:
|
||||||
|
kwargs['location_detail'] = str2bool(self.request.GET.get('location_detail', False))
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
kwargs['context'] = self.get_serializer_context()
|
||||||
|
|
||||||
|
return self.serializer_class(*args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class StockFilter(FilterSet):
|
class StockFilter(FilterSet):
|
||||||
""" FilterSet for advanced stock filtering.
|
""" FilterSet for advanced stock filtering.
|
||||||
@ -317,6 +333,7 @@ class StockList(generics.ListCreateAPIView):
|
|||||||
'batch',
|
'batch',
|
||||||
'status',
|
'status',
|
||||||
'notes',
|
'notes',
|
||||||
|
'link',
|
||||||
'location',
|
'location',
|
||||||
'location__name',
|
'location__name',
|
||||||
'location__description',
|
'location__description',
|
||||||
|
@ -42,9 +42,9 @@ class CreateStockItemForm(HelperForm):
|
|||||||
'quantity',
|
'quantity',
|
||||||
'batch',
|
'batch',
|
||||||
'serial_numbers',
|
'serial_numbers',
|
||||||
|
'link',
|
||||||
'delete_on_deplete',
|
'delete_on_deplete',
|
||||||
'status',
|
'status',
|
||||||
'URL',
|
|
||||||
]
|
]
|
||||||
|
|
||||||
# Custom clean to prevent complex StockItem.clean() logic from running (yet)
|
# Custom clean to prevent complex StockItem.clean() logic from running (yet)
|
||||||
@ -161,7 +161,7 @@ class EditStockItemForm(HelperForm):
|
|||||||
'serial',
|
'serial',
|
||||||
'batch',
|
'batch',
|
||||||
'status',
|
'status',
|
||||||
'URL',
|
'link',
|
||||||
'delete_on_deplete',
|
'delete_on_deplete',
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -176,5 +176,5 @@ class TrackingEntryForm(HelperForm):
|
|||||||
fields = [
|
fields = [
|
||||||
'title',
|
'title',
|
||||||
'notes',
|
'notes',
|
||||||
'URL',
|
'link',
|
||||||
]
|
]
|
||||||
|
19
InvenTree/stock/migrations/0024_auto_20200405_2239.py
Normal file
19
InvenTree/stock/migrations/0024_auto_20200405_2239.py
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Generated by Django 2.2.10 on 2020-04-05 22:39
|
||||||
|
|
||||||
|
import InvenTree.fields
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('stock', '0023_auto_20200318_1027'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='stockitem',
|
||||||
|
name='URL',
|
||||||
|
field=InvenTree.fields.InvenTreeURLField(blank=True, help_text='Link to external URL', max_length=125),
|
||||||
|
),
|
||||||
|
]
|
23
InvenTree/stock/migrations/0025_auto_20200405_2243.py
Normal file
23
InvenTree/stock/migrations/0025_auto_20200405_2243.py
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Generated by Django 2.2.10 on 2020-04-05 22:43
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('stock', '0024_auto_20200405_2239'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='stockitem',
|
||||||
|
old_name='URL',
|
||||||
|
new_name='link',
|
||||||
|
),
|
||||||
|
migrations.RenameField(
|
||||||
|
model_name='stockitemtracking',
|
||||||
|
old_name='URL',
|
||||||
|
new_name='link',
|
||||||
|
),
|
||||||
|
]
|
@ -114,7 +114,7 @@ class StockItem(MPTTModel):
|
|||||||
quantity: Number of stocked units
|
quantity: Number of stocked units
|
||||||
batch: Batch number for this StockItem
|
batch: Batch number for this StockItem
|
||||||
serial: Unique serial number for this StockItem
|
serial: Unique serial number for this StockItem
|
||||||
URL: Optional URL to link to external resource
|
link: Optional URL to link to external resource
|
||||||
updated: Date that this stock item was last updated (auto)
|
updated: Date that this stock item was last updated (auto)
|
||||||
stocktake_date: Date of last stocktake for this item
|
stocktake_date: Date of last stocktake for this item
|
||||||
stocktake_user: User that performed the most recent stocktake
|
stocktake_user: User that performed the most recent stocktake
|
||||||
@ -328,7 +328,7 @@ class StockItem(MPTTModel):
|
|||||||
serial = models.PositiveIntegerField(blank=True, null=True,
|
serial = models.PositiveIntegerField(blank=True, null=True,
|
||||||
help_text=_('Serial number for this item'))
|
help_text=_('Serial number for this item'))
|
||||||
|
|
||||||
URL = InvenTreeURLField(max_length=125, blank=True)
|
link = InvenTreeURLField(max_length=125, blank=True, help_text=_("Link to external URL"))
|
||||||
|
|
||||||
batch = models.CharField(max_length=100, blank=True, null=True,
|
batch = models.CharField(max_length=100, blank=True, null=True,
|
||||||
help_text=_('Batch code for this stock item'))
|
help_text=_('Batch code for this stock item'))
|
||||||
@ -427,7 +427,7 @@ class StockItem(MPTTModel):
|
|||||||
quantity=self.quantity,
|
quantity=self.quantity,
|
||||||
date=datetime.now().date(),
|
date=datetime.now().date(),
|
||||||
notes=notes,
|
notes=notes,
|
||||||
URL=url,
|
link=url,
|
||||||
system=system
|
system=system
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -793,7 +793,7 @@ class StockItemTracking(models.Model):
|
|||||||
date: Date that this tracking info was created
|
date: Date that this tracking info was created
|
||||||
title: Title of this tracking info (generated by system)
|
title: Title of this tracking info (generated by system)
|
||||||
notes: Associated notes (input by user)
|
notes: Associated notes (input by user)
|
||||||
URL: Optional URL to external page
|
link: Optional URL to external page
|
||||||
user: The user associated with this tracking info
|
user: The user associated with this tracking info
|
||||||
quantity: The StockItem quantity at this point in time
|
quantity: The StockItem quantity at this point in time
|
||||||
"""
|
"""
|
||||||
@ -811,7 +811,7 @@ class StockItemTracking(models.Model):
|
|||||||
|
|
||||||
notes = models.CharField(blank=True, max_length=512, help_text=_('Entry notes'))
|
notes = models.CharField(blank=True, max_length=512, help_text=_('Entry notes'))
|
||||||
|
|
||||||
URL = InvenTreeURLField(blank=True, help_text=_('Link to external page for further information'))
|
link = InvenTreeURLField(blank=True, help_text=_('Link to external page for further information'))
|
||||||
|
|
||||||
user = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True)
|
user = models.ForeignKey(User, on_delete=models.SET_NULL, blank=True, null=True)
|
||||||
|
|
||||||
|
@ -59,6 +59,8 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
|||||||
|
|
||||||
part_name = serializers.CharField(source='get_part_name', read_only=True)
|
part_name = serializers.CharField(source='get_part_name', read_only=True)
|
||||||
|
|
||||||
|
part_image = serializers.CharField(source='part__image', read_only=True)
|
||||||
|
|
||||||
part_detail = PartBriefSerializer(source='part', many=False, read_only=True)
|
part_detail = PartBriefSerializer(source='part', many=False, read_only=True)
|
||||||
location_detail = LocationBriefSerializer(source='location', many=False, read_only=True)
|
location_detail = LocationBriefSerializer(source='location', many=False, read_only=True)
|
||||||
|
|
||||||
@ -78,21 +80,23 @@ class StockItemSerializer(InvenTreeModelSerializer):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = StockItem
|
model = StockItem
|
||||||
fields = [
|
fields = [
|
||||||
'pk',
|
'batch',
|
||||||
'url',
|
'in_stock',
|
||||||
'part',
|
'link',
|
||||||
'part_name',
|
|
||||||
'part_detail',
|
|
||||||
'supplier_part',
|
|
||||||
'location',
|
'location',
|
||||||
'location_detail',
|
'location_detail',
|
||||||
'in_stock',
|
'notes',
|
||||||
|
'part',
|
||||||
|
'part_detail',
|
||||||
|
'part_name',
|
||||||
|
'part_image',
|
||||||
|
'pk',
|
||||||
'quantity',
|
'quantity',
|
||||||
'serial',
|
'serial',
|
||||||
'batch',
|
'supplier_part',
|
||||||
'status',
|
'status',
|
||||||
'status_text',
|
'status_text',
|
||||||
'notes',
|
'url',
|
||||||
]
|
]
|
||||||
|
|
||||||
""" These fields are read-only in this context.
|
""" These fields are read-only in this context.
|
||||||
@ -152,7 +156,7 @@ class StockTrackingSerializer(InvenTreeModelSerializer):
|
|||||||
'date',
|
'date',
|
||||||
'title',
|
'title',
|
||||||
'notes',
|
'notes',
|
||||||
'URL',
|
'link',
|
||||||
'quantity',
|
'quantity',
|
||||||
'user',
|
'user',
|
||||||
'system',
|
'system',
|
||||||
|
@ -74,6 +74,7 @@
|
|||||||
<div class='col-sm-6'>
|
<div class='col-sm-6'>
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-shapes'></span></td>
|
||||||
<td>Part</td>
|
<td>Part</td>
|
||||||
<td>
|
<td>
|
||||||
{% include "hover_image.html" with image=item.part.image hover=True %}
|
{% include "hover_image.html" with image=item.part.image hover=True %}
|
||||||
@ -82,71 +83,84 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% if item.belongs_to %}
|
{% if item.belongs_to %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>{% trans "Belongs To" %}</td>
|
<td>{% trans "Belongs To" %}</td>
|
||||||
<td><a href="{% url 'stock-item-detail' item.belongs_to.id %}">{{ item.belongs_to }}</a></td>
|
<td><a href="{% url 'stock-item-detail' item.belongs_to.id %}">{{ item.belongs_to }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% elif item.location %}
|
{% elif item.location %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-map-marker-alt'></span></td>
|
||||||
<td>{% trans "Location" %}</td>
|
<td>{% trans "Location" %}</td>
|
||||||
<td><a href="{% url 'stock-location-detail' item.location.id %}">{{ item.location.name }}</a></td>
|
<td><a href="{% url 'stock-location-detail' item.location.id %}">{{ item.location.name }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.serialized %}
|
{% if item.serialized %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>{% trans "Serial Number" %}</td>
|
<td>{% trans "Serial Number" %}</td>
|
||||||
<td>{{ item.serial }}</td>
|
<td>{{ item.serial }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% else %}
|
{% else %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>{% trans "Quantity" %}</td>
|
<td>{% trans "Quantity" %}</td>
|
||||||
<td>{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}</td>
|
<td>{% decimal item.quantity %} {% if item.part.units %}{{ item.part.units }}{% endif %}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.batch %}
|
{% if item.batch %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>{% trans "Batch" %}</td>
|
<td>{% trans "Batch" %}</td>
|
||||||
<td>{{ item.batch }}</td>
|
<td>{{ item.batch }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.build %}
|
{% if item.build %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-tools'></span></td>
|
||||||
<td>{% trans "Build" %}</td>
|
<td>{% trans "Build" %}</td>
|
||||||
<td><a href="{% url 'build-detail' item.build.id %}">{{ item.build }}</a></td>
|
<td><a href="{% url 'build-detail' item.build.id %}">{{ item.build }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.purchase_order %}
|
{% if item.purchase_order %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>{% trans "Purchase Order" %}</td>
|
<td>{% trans "Purchase Order" %}</td>
|
||||||
<td><a href="{% url 'po-detail' item.purchase_order.id %}">{{ item.purchase_order }}</a></td>
|
<td><a href="{% url 'po-detail' item.purchase_order.id %}">{{ item.purchase_order }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.customer %}
|
{% if item.customer %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td>{% trans "Customer" %}</td>
|
<td>{% trans "Customer" %}</td>
|
||||||
<td>{{ item.customer.name }}</td>
|
<td>{{ item.customer.name }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.URL %}
|
{% if item.link %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{% trans "URL" %}</td>
|
<td><span class='fas fa-link'></span>
|
||||||
<td><a href="{{ item.URL }}">{{ item.URL }}</a></td>
|
<td>{% trans "External Link" %}</td>
|
||||||
|
<td><a href="{{ item.link }}">{{ item.link }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if item.supplier_part %}
|
{% if item.supplier_part %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-industry'></span></td>
|
||||||
<td>{% trans "Supplier" %}</td>
|
<td>{% trans "Supplier" %}</td>
|
||||||
<td><a href="{% url 'company-detail' item.supplier_part.supplier.id %}">{{ item.supplier_part.supplier.name }}</a></td>
|
<td><a href="{% url 'company-detail' item.supplier_part.supplier.id %}">{{ item.supplier_part.supplier.name }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-shapes'></span></td>
|
||||||
<td>{% trans "Supplier Part" %}</td>
|
<td>{% trans "Supplier Part" %}</td>
|
||||||
<td><a href="{% url 'supplier-part-detail' item.supplier_part.id %}">{{ item.supplier_part.SKU }}</a></td>
|
<td><a href="{% url 'supplier-part-detail' item.supplier_part.id %}">{{ item.supplier_part.SKU }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Last Updated" %}</td>
|
<td>{% trans "Last Updated" %}</td>
|
||||||
<td>{{ item.updated }}</td>
|
<td>{{ item.updated }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-calendar-alt'></span></td>
|
||||||
<td>{% trans "Last Stocktake" %}</td>
|
<td>{% trans "Last Stocktake" %}</td>
|
||||||
{% if item.stocktake_date %}
|
{% if item.stocktake_date %}
|
||||||
<td>{{ item.stocktake_date }} <span class='badge'>{{ item.stocktake_user }}</span></td>
|
<td>{{ item.stocktake_date }} <span class='badge'>{{ item.stocktake_user }}</span></td>
|
||||||
@ -155,6 +169,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><span class='fas fa-info'></span></td>
|
||||||
<td>{% trans "Status" %}</td>
|
<td>{% trans "Status" %}</td>
|
||||||
<td>{{ item.get_status_display }}</td>
|
<td>{{ item.get_status_display }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -934,7 +934,7 @@ class StockItemCreate(AjaxCreateView):
|
|||||||
batch=form_data.get('batch'),
|
batch=form_data.get('batch'),
|
||||||
delete_on_deplete=False,
|
delete_on_deplete=False,
|
||||||
status=form_data.get('status'),
|
status=form_data.get('status'),
|
||||||
URL=form_data.get('URL'),
|
link=form_data.get('link'),
|
||||||
)
|
)
|
||||||
|
|
||||||
item.save(user=request.user)
|
item.save(user=request.user)
|
||||||
|
Loading…
Reference in New Issue
Block a user