Merge branch 'master' of https://github.com/inventree/InvenTree into price-history

This commit is contained in:
Matthias 2021-04-18 12:58:19 +02:00
commit 6c3a66f7d6
26 changed files with 2829 additions and 2075 deletions

View File

@ -13,6 +13,9 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@v2
- name: cd
run: |
cd docker
- name: Push to Docker Hub
uses: docker/build-push-action@v1
with:
@ -20,4 +23,4 @@ jobs:
password: ${{ secrets.DOCKER_PASSWORD }}
repository: inventree/inventree
tag_with_ref: true
dockerfile: docker/Dockerfile
dockerfile: ./Dockerfile

View File

@ -3,6 +3,7 @@
{% load static %}
{% load i18n %}
{% load status_codes %}
{% load inventree_extras %}
{% block page_title %}
InvenTree | {% trans "Build Order" %} - {{ build }}
@ -11,12 +12,14 @@ InvenTree | {% trans "Build Order" %} - {{ build }}
{% block pre_content %}
{% if build.sales_order %}
<div class='alert alert-block alert-info'>
{% trans "This Build Order is allocated to Sales Order" %} <b><a href="{% url 'so-detail' build.sales_order.id %}">{{ build.sales_order }}</a></b>
{% object_link 'so-detail' build.sales_order.id build.sales_order as link %}
{% blocktrans %}This Build Order is allocated to Sales Order {{link}}{% endblocktrans %}
</div>
{% endif %}
{% if build.parent %}
<div class='alert alert-block alert-info'>
{% trans "This Build Order is a child of Build Order" %} <b><a href="{% url 'build-detail' build.parent.id %}">{{ build.parent }}</a></b>
{% object_link 'build-detail' build.parent.id build.parent as link %}
{% blocktrans %}This Build Order is a child of Build Order {{link}}{% endblocktrans %}
</div>
{% endif %}
{% endblock %}
@ -105,7 +108,7 @@ src="{% static 'img/blank_image.png' %}"
<td>
{{ build.target_date }}
{% if build.is_overdue %}
<span title='{% trans "This build was due on" %} {{ build.target_date }}' class='label label-red'>{% trans "Overdue" %}</span>
<span title='{% blocktrans with target=build.target_date %}This build was due on {{target}}{% endblocktrans %}' class='label label-red'>{% trans "Overdue" %}</span>
{% endif %}
</td>
</tr>

View File

@ -8,15 +8,13 @@
</p>
{% if output %}
<p>
{% trans "The allocated stock will be installed into the following build output:" %}
<br>
<i>{{ output }}</i>
{% blocktrans %}The allocated stock will be installed into the following build output:<br><i>{{output}}</i>{% endblocktrans %}
</p>
{% endif %}
</div>
{% if no_stock %}
<div class='alert alert-danger alert-block' role='alert'>
{% trans "No stock available for" %} {{ part }}
{% blocktrans %}No stock available for {{part}}{% endblocktrans %}
</div>
{% endif %}
{% endblock %}

View File

@ -33,8 +33,7 @@
</table>
{% if part.supplier_parts.all|length > 0 %}
<div class='alert alert-block alert-danger'>
<p>There are {{ part.supplier_parts.all|length }} suppliers defined for this manufacturer part. If you delete it, the following supplier parts will also be deleted:
</p>
<p>{% blocktrans with count=part.supplier_parts.all|length %}There are {{count}} suppliers defined for this manufacturer part. If you delete it, the following supplier parts will also be deleted:{% endblocktrans %}</p>
<ul class='list-group' style='margin-top:10px'>
{% for spart in part.supplier_parts.all %}
<li class='list-group-item'>{{ spart.supplier.name }} - {{ spart.SKU }}</li>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -7,8 +7,8 @@
{% trans 'Mark this order as complete?' %}
{% if not order.is_complete %}
<div class='alert alert-warning alert-block'>
{%trans 'This order has line items which have not been marked as received.
Marking this order as complete will remove these line items.' %}
{% trans 'This order has line items which have not been marked as received.' %}
{% trans 'Marking this order as complete will remove these line items.' %}
</div>
{% endif %}

View File

@ -54,7 +54,7 @@
</select>
</div>
{% if not part.order_supplier %}
<span class='help-inline'>{% trans "Select a supplier for" %} <i>{{ part.name }}</i></span>
<span class='help-inline'>{% blocktrans with name=part.name %}Select a supplier for <i>{{name}}</i>{% endblocktrans %}</span>
{% endif %}
</div>
</td>

View File

@ -42,7 +42,7 @@
<button
class='btn btn-default btn-create'
id='new_po_{{ supplier.id }}'
title='{% trans "Create new purchase order for {{ supplier.name }}" %}'
title='{% blocktrans with name=supplier.name %}Create new purchase order for {{name}}{% endblocktrans %}'
type='button'
supplierid='{{ supplier.id }}'
onclick='newPurchaseOrderFromOrderWizard()'>
@ -65,7 +65,7 @@
</select>
</div>
{% if not supplier.selected_purchase_order %}
<span class='help-inline'>{% trans "Select a purchase order for" %} {{ supplier.name }}</span>
<span class='help-inline'>{% blocktrans with name=supplier.name %}Select a purchase order for {{name}}{% endblocktrans %}</span>
{% endif %}
</div>
</td>

View File

@ -5,7 +5,7 @@
{% block form %}
{% trans "Receive outstanding parts for" %} <b>{{ order }}</b> - <i>{{ order.description }}</i>
{% blocktrans with desc=order.description %}Receive outstanding parts for <b>{{order}}</b> - <i>{{desc}}</i>{% endblocktrans %}
<form method='post' action='' class='js-modal-form' enctype='multipart/form-data'>
{% csrf_token %}

View File

@ -5,7 +5,7 @@
{% trans 'Are you sure you want to delete category' %} <strong>{{ category.name }}</strong>?
{% if category.children.all|length > 0 %}
<p>{% trans 'This category contains' %} {{ category.children.all|length }} {% trans 'child categories' %}.<br>
<p>{% blocktrans with count=category.children.all|length%}This category contains {{count}} child categories{% endblocktrans %}.<br>
{% trans 'If this category is deleted, these child categories will be moved to the' %}
{% if category.parent %}
<strong>{{ category.parent.name }}</strong> {% trans 'category' %}.
@ -22,9 +22,9 @@
{% endif %}
{% if category.parts.all|length > 0 %}
<p>{% trans 'This category contains' %} {{ category.parts.all|length }} {% trans 'parts' %}.<br>
<p>{% blocktrans with count=category.parts.all|length %}This category contains {{count}} parts{% endblocktrans %}.<br>
{% if category.parent %}
{% trans 'If this category is deleted, these parts will be moved to the parent category' %} {{ category.parent.pathstring }}
{% blocktrans with path=category.parent.pathstring %}If this category is deleted, these parts will be moved to the parent category {{path}}{% endblocktrans %}
{% else %}
{% trans 'If this category is deleted, these parts will be moved to the top-level category Teile' %}
{% endif %}

View File

@ -7,7 +7,7 @@
<div class='alert alert-info alert-block'>
<strong>{% trans 'Duplicate Part' %}</strong><br>
{% trans 'Make a copy of part' %} '{{ part.full_name }}'.
{% blocktrans with full_name=part.full_name %}Make a copy of part '{{full_name}}'.{% endblocktrans %}
</div>
{% if matches %}

View File

@ -13,7 +13,8 @@
<ul class='list-group'>
{% for match in matches %}
<li class='list-group-item list-group-item-condensed'>
{{ match.part.full_name }} - <i>{{ match.part.description }}</i> ({% decimal match.ratio %}% {% trans "match" %})
{% decimal match.ratio as match_per %}
{% blocktrans with full_name=match.part.full_name desc=match.part.description %}{{full_name}} - <i>{{desc}}</i> ({{match_per}}% match){% endblocktrans %}
</li>
{% endfor %}
</ul>

View File

@ -14,7 +14,8 @@
{% if part.variant_of %}
<div class='alert alert-info alert-block'>
{% trans "This part is a variant of" %} <strong><a href="{% url 'part-variants' part.variant_of.id %}">{{ part.variant_of.full_name }}</a></strong>
{% object_link 'part-variants' part.variant_of.id part.variant_of.full_name as link %}
{% blocktrans %}This part is a variant of {{link}}{% endblocktrans %}
</div>
{% endif %}

View File

@ -4,8 +4,7 @@
{% block pre_form_content %}
<div class='alert alert-info alert-block'>
{% trans 'Pricing information for:' %}<br>
{{ part }}.
{% blocktrans %}Pricing information for:<br>{{part}}.{% endblocktrans %}
</div>
<h4>{% trans 'Quantity' %}</h4>

View File

@ -4,12 +4,12 @@
{% block pre_form_content %}
<div class='alert alert-block alert-danger'>
{% trans "Are you sure you want to delete part" %} '<b>{{ part.full_name }}</b>'?
{% blocktrans with full_name=part.full_name %}Are you sure you want to delete part '<b>{{full_name}}</b>'?{% endblocktrans %}
</div>
{% if part.used_in_count %}
<hr>
<p>{% trans "This part is used in BOMs for" %} {{ part.used_in_count }} {% trans "other parts. If you delete this part, the BOMs for the following parts will be updated" %}:
<p>{% blocktrans with count=part.used_in_count %}This part is used in BOMs for {{count}} other parts. If you delete this part, the BOMs for the following parts will be updated{% endblocktrans %}:
<ul class="list-group">
{% for child in part.used_in.all %}
<li class='list-group-item'>{{ child.part.full_name }} - {{ child.part.description }}</li>
@ -19,7 +19,7 @@
{% if part.stock_items.all|length > 0 %}
<hr>
<p>{% trans "There are" %} {{ part.stock_items.all|length }} {% trans "stock entries defined for this part. If you delete this part, the following stock entries will also be deleted" %}:
<p>{% blocktrans with count=part.stock_items.all|length %}There are {{count}} stock entries defined for this part. If you delete this part, the following stock entries will also be deleted:{% endblocktrans %}
<ul class='list-group'>
{% for stock in part.stock_items.all %}
<li class='list-group-item'>{{ stock }}</li>
@ -30,7 +30,7 @@
{% if part.manufacturer_parts.all|length > 0 %}
<hr>
<p>{% trans "There are" %} {{ part.manufacturer_parts.all|length }} {% trans "manufacturers defined for this part. If you delete this part, the following manufacturer parts will also be deleted" %}:
<p>{% blocktrans with count=part.manufacturer_parts.all|length %}There are {{count}} manufacturers defined for this part. If you delete this part, the following manufacturer parts will also be deleted:{% endblocktrans %}
<ul class='list-group'>
{% for spart in part.manufacturer_parts.all %}
<li class='list-group-item'>{{ spart.manufacturer.name }} - {{ spart.MPN }}</li>
@ -41,7 +41,7 @@
{% if part.supplier_parts.all|length > 0 %}
<hr>
<p>{% trans "There are" %} {{ part.supplier_parts.all|length }} {% trans "suppliers defined for this part. If you delete this part, the following supplier parts will also be deleted" %}:
<p>{% blocktrans with count=part.supplier_parts.all|length %}There are {{count}} suppliers defined for this part. If you delete this part, the following supplier parts will also be deleted:{% endblocktrans %}
<ul class='list-group'>
{% for spart in part.supplier_parts.all %}
<li class='list-group-item'>{{ spart.supplier.name }} - {{ spart.SKU }}</li>
@ -52,7 +52,7 @@
{% if part.serials.all|length > 0 %}
<hr>
<p>{% trans "There are" %} {{ part.serials.all|length }} {% trans "unique parts tracked for" %} '{{ part.full_name }}'. {% trans "Deleting this part will permanently remove this tracking information" %}.</p>
<p>{% blocktrans with count=part.serials.all|length full_name=part.full_name %}There are {{count}} unique parts tracked for '{{full_name}}'. Deleting this part will permanently remove this tracking information.{% endblocktrans %}</p>
{% endif %}
{% endblock %}

View File

@ -13,7 +13,7 @@
{% block details %}
{% if part.is_template %}
<div class='alert alert-info alert-block'>
{% trans 'Showing stock for all variants of' %} <i>{{ part.full_name }}</i>
{% blocktrans with full_name=part.full_name%}Showing stock for all variants of <i>{{full_name}}</i>{% endblocktrans %}
</div>
{% endif %}

View File

@ -7,7 +7,7 @@
<div class='alert alert-info alert-block'>
<b>{% trans "Create new part variant" %}</b><br>
{% trans "Create a new variant of template" %} <i>'{{ part.full_name }}'</i>.
{% blocktrans with full_name=part.full_name %}Create a new variant of template <i>'{{full_name}}'</i>.{% endblocktrans %}
</div>
{% endblock %}

View File

@ -4,6 +4,8 @@ over and above the built-in Django tags.
import os
from django import template
from django.urls import reverse
from django.utils.safestring import mark_safe
from InvenTree import version, settings
import InvenTree.helpers
@ -164,3 +166,11 @@ def authorized_owners(group):
pass
return owners
@register.simple_tag()
def object_link(url_name, pk, ref):
""" Return highlighted link to object """
ref_url = reverse(url_name, kwargs={'pk': pk})
return mark_safe('<b><a href="{}">{}</a></b>'.format(ref_url, ref))

View File

@ -48,13 +48,17 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
{% for allocation in item.sales_order_allocations.all %}
<div class='alert alert-block alert-info'>
{% trans "This stock item is allocated to Sales Order" %} <a href="{% url 'so-detail' allocation.line.order.id %}"><b>#{{ allocation.line.order }}</b></a> ({% trans "Quantity" %}: {% decimal allocation.quantity %})
{% object_link 'so-detail' allocation.line.order.id allocation.line.order as link %}
{% decimal allocation.quantity as qty %}
{% blocktrans %}This stock item is allocated to Sales Order {{ link }} (Quantity: {{ qty }}){% endblocktrans %}
</div>
{% endfor %}
{% for allocation in item.allocations.all %}
<div class='alert alert-block alert-info'>
{% trans "This stock item is allocated to Build" %} <a href="{% url 'build-detail' allocation.build.id %}"><b>#{{ allocation.build }}</b></a> ({% trans "Quantity" %}: {% decimal allocation.quantity %})
{% object_link 'build-detail' allocation.build.id allocation.build %}
{% decimal allocation.quantity as qty %}
{% blocktrans %}This stock item is allocated to Build {{ link }} (Quantity: {{ qty }}){% endblocktrans %}
</div>
{% endfor %}
@ -362,9 +366,9 @@ InvenTree | {% trans "Stock Item" %} - {{ item }}
<td>
{{ item.expiry_date }}
{% if item.is_expired %}
<span title='{% trans "This StockItem expired on" %} {{ item.expiry_date }}' class='label label-red'>{% trans "Expired" %}</span>
<span title='{% blocktrans %}This StockItem expired on {{ item.expiry_date }}{% endblocktrans %}' class='label label-red'>{% trans "Expired" %}</span>
{% elif item.is_stale %}
<span title='{% trans "This StockItem expires on" %} {{ item.expiry_date }}' class='label label-yellow'>{% trans "Stale" %}</span>
<span title='{% blocktrans %}This StockItem expires on {{ item.expiry_date }}{% endblocktrans %}' class='label label-yellow'>{% trans "Stale" %}</span>
{% endif %}
</td>
</tr>

View File

@ -8,7 +8,8 @@
<div class='alert alert-danger alert-block'>
{% trans "Are you sure you want to delete this stock item?" %}
<br>
This will remove <b>{% decimal item.quantity %}</b> units of <b>{{ item.part.full_name }}</b> from stock.
{% decimal item.quantity as qty %}
{% blocktrans with full_name=item.part.full_name %}This will remove <b>{{qty}}</b> units of <b>{{full_name}}</b> from stock.{% endblocktrans %}
</div>
{% endblock %}

View File

@ -5,7 +5,7 @@
<div class='alert alert-block alert-info'>
<b>{% trans "Convert Stock Item" %}</b><br>
{% trans "This stock item is current an instance of " %}<i>{{ item.part }}</i><br>
{% blocktrans with part=item.part %}This stock item is current an instance of <i>{{part}}</i>{% endblocktrans %}<br>
{% trans "It can be converted to one of the part variants listed below." %}
</div>

View File

@ -3,7 +3,7 @@
{% block pre_form_content %}
<div class='alert alert-danger alert-block'>
Are you sure you want to delete this stock tracking entry?
{% trans "Are you sure you want to delete this stock tracking entry?" %}
</div>
{% endblock %}

View File

@ -268,6 +268,10 @@ function loadBomTable(table, options) {
field: 'optional',
title: '{% trans "Optional" %}',
searchable: false,
formatter: function(value) {
if (value == '1') return '{% trans "true" %}';
if (value == '0') return '{% trans "false" %}';
}
});
cols.push({

View File

@ -1,5 +1,7 @@
{% load i18n %}
{% if value %}
<span class='label label-success'>Yes</span>
<span class='label label-success'>{% trans 'Yes' %}</span>
{% else %}
<span class='label label-warning'>No</span>
<span class='label label-warning'>{% trans 'No' %}</span>
{% endif %}