mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-03 22:55:43 +00:00 
			
		
		
		
	Merge remote-tracking branch 'inventree/master' into subscription-refactor
This commit is contained in:
		@@ -142,7 +142,7 @@
 | 
				
			|||||||
                        <td><span class='fas fa-calendar-alt'></span></td>
 | 
					                        <td><span class='fas fa-calendar-alt'></span></td>
 | 
				
			||||||
                        <td>{% trans "Completed" %}</td>
 | 
					                        <td>{% trans "Completed" %}</td>
 | 
				
			||||||
                        {% if build.completion_date %}
 | 
					                        {% if build.completion_date %}
 | 
				
			||||||
                        <td>{{ build.completion_date }}{% if build.completed_by %}<span class='badge'>{{ build.completed_by }}</span>{% endif %}</td>
 | 
					                        <td>{{ build.completion_date }}{% if build.completed_by %}<span class='badge badge-right rounded-pill bg-dark'>{{ build.completed_by }}</span>{% endif %}</td>
 | 
				
			||||||
                        {% else %}
 | 
					                        {% else %}
 | 
				
			||||||
                        <td><em>{% trans "Build not complete" %}</em></td>
 | 
					                        <td><em>{% trans "Build not complete" %}</em></td>
 | 
				
			||||||
                        {% endif %}
 | 
					                        {% endif %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -123,7 +123,7 @@ src="{% static 'img/blank_image.png' %}"
 | 
				
			|||||||
    <tr>
 | 
					    <tr>
 | 
				
			||||||
        <td><span class='fas fa-calendar-alt'></span></td>
 | 
					        <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 badge-right rounded-pill bg-dark'>{{ order.created_by }}</span></td>
 | 
				
			||||||
    </tr>
 | 
					    </tr>
 | 
				
			||||||
    {% if order.issue_date %}
 | 
					    {% if order.issue_date %}
 | 
				
			||||||
    <tr>
 | 
					    <tr>
 | 
				
			||||||
@@ -143,7 +143,7 @@ src="{% static 'img/blank_image.png' %}"
 | 
				
			|||||||
    <tr>
 | 
					    <tr>
 | 
				
			||||||
        <td><span class='fas fa-calendar-alt'></span></td>
 | 
					        <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 badge-right rounded-pill bg-dark'>{{ order.received_by }}</span></td>
 | 
				
			||||||
    </tr>
 | 
					    </tr>
 | 
				
			||||||
    {% endif %}
 | 
					    {% endif %}
 | 
				
			||||||
    {% if order.responsible %}
 | 
					    {% if order.responsible %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -128,7 +128,7 @@ src="{% static 'img/blank_image.png' %}"
 | 
				
			|||||||
    <tr>
 | 
					    <tr>
 | 
				
			||||||
        <td><span class='fas fa-calendar-alt'></span></td>
 | 
					        <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 badge-right rounded-pill bg-dark'>{{ order.created_by }}</span></td>
 | 
				
			||||||
    </tr>
 | 
					    </tr>
 | 
				
			||||||
    {% if order.target_date %}
 | 
					    {% if order.target_date %}
 | 
				
			||||||
    <tr>
 | 
					    <tr>
 | 
				
			||||||
@@ -141,14 +141,14 @@ src="{% static 'img/blank_image.png' %}"
 | 
				
			|||||||
    <tr>
 | 
					    <tr>
 | 
				
			||||||
        <td><span class='fas fa-truck'></span></td>
 | 
					        <td><span class='fas fa-truck'></span></td>
 | 
				
			||||||
        <td>{% trans "Shipped" %}</td>
 | 
					        <td>{% trans "Shipped" %}</td>
 | 
				
			||||||
        <td>{{ order.shipment_date }}<span class='badge'>{{ order.shipped_by }}</span></td>
 | 
					        <td>{{ order.shipment_date }}<span class='badge badge-right rounded-pill bg-dark'>{{ order.shipped_by }}</span></td>
 | 
				
			||||||
    </tr>
 | 
					    </tr>
 | 
				
			||||||
    {% endif %}
 | 
					    {% endif %}
 | 
				
			||||||
    {% if order.status == PurchaseOrderStatus.COMPLETE %}
 | 
					    {% if order.status == PurchaseOrderStatus.COMPLETE %}
 | 
				
			||||||
    <tr>
 | 
					    <tr>
 | 
				
			||||||
        <td><span class='fas fa-calendar-alt'></span></td>
 | 
					        <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 badge-right rounded-pill bg-dark'>{{ order.received_by }}</span></td>
 | 
				
			||||||
    </tr>
 | 
					    </tr>
 | 
				
			||||||
    {% endif %}
 | 
					    {% endif %}
 | 
				
			||||||
    {% if order.responsible %}
 | 
					    {% if order.responsible %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,58 +8,55 @@
 | 
				
			|||||||
{% include "sidebar_link.html" with url=url text="Return to BOM" icon="fa-undo" %}
 | 
					{% include "sidebar_link.html" with url=url text="Return to BOM" icon="fa-undo" %}
 | 
				
			||||||
{% endblock %}
 | 
					{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block page_content %}
 | 
					{% block heading %}
 | 
				
			||||||
 | 
					{% trans "Upload Bill of Materials" %}
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<div class='panel' id='panel-upload-file'>
 | 
					{% block actions %}
 | 
				
			||||||
    <div class='panel-heading'>
 | 
					{% endblock %}
 | 
				
			||||||
        {% block heading %}
 | 
					
 | 
				
			||||||
        <h4>{% trans "Upload Bill of Materials" %}</h4>
 | 
					{% block page_info %}
 | 
				
			||||||
        {{ wizard.form.media }}
 | 
					<div class='panel-content'>
 | 
				
			||||||
        {% endblock %}
 | 
					    <p>{% blocktrans with step=wizard.steps.step1 count=wizard.steps.count %}Step {{step}} of {{count}}{% endblocktrans %}
 | 
				
			||||||
 | 
					    {% if description %}- {{ description }}{% endif %}</p>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <form action="" method="post" class='js-modal-form' enctype="multipart/form-data">
 | 
				
			||||||
 | 
					    {% csrf_token %}
 | 
				
			||||||
 | 
					    {% load crispy_forms_tags %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    {% block form_buttons_top %}
 | 
				
			||||||
 | 
					    {% endblock form_buttons_top %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    {% block form_alert %}
 | 
				
			||||||
 | 
					    <div class='alert alert-info alert-block'>
 | 
				
			||||||
 | 
					        <strong>{% trans "Requirements for BOM upload" %}:</strong>
 | 
				
			||||||
 | 
					        <ul>
 | 
				
			||||||
 | 
					            <li>{% trans "The BOM file must contain the required named columns as provided in the " %} <strong><a href="/part/bom_template/">{% trans "BOM Upload Template" %}</a></strong></li>
 | 
				
			||||||
 | 
					            <li>{% trans "Each part must already exist in the database" %}</li>
 | 
				
			||||||
 | 
					        </ul>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    <div class='panel-content'>
 | 
					    {% endblock %} 
 | 
				
			||||||
        {% block details %}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <p>{% blocktrans with step=wizard.steps.step1 count=wizard.steps.count %}Step {{step}} of {{count}}{% endblocktrans %}
 | 
					    <table class='table table-striped' style='margin-top: 12px; margin-bottom: 0px'>
 | 
				
			||||||
        {% if description %}- {{ description }}{% endif %}</p>
 | 
					    {{ wizard.management_form }}
 | 
				
			||||||
 | 
					    {% block form_content %}
 | 
				
			||||||
 | 
					    {% crispy wizard.form %}
 | 
				
			||||||
 | 
					    {% endblock form_content %}
 | 
				
			||||||
 | 
					    </table>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <form action="" method="post" class='js-modal-form' enctype="multipart/form-data">
 | 
					    {% block form_buttons_bottom %}
 | 
				
			||||||
        {% csrf_token %}
 | 
					    {% if wizard.steps.prev %}
 | 
				
			||||||
        {% load crispy_forms_tags %}
 | 
					    <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}" class="save btn btn-outline-secondary">{% trans "Previous Step" %}</button>
 | 
				
			||||||
 | 
					    {% endif %}
 | 
				
			||||||
        {% block form_buttons_top %}
 | 
					    <button type="submit" class="save btn btn-outline-secondary">{% trans "Upload File" %}</button>
 | 
				
			||||||
        {% endblock form_buttons_top %}
 | 
					    </form>
 | 
				
			||||||
 | 
					    {% endblock form_buttons_bottom %}
 | 
				
			||||||
        {% block form_alert %}
 | 
					</div>
 | 
				
			||||||
        <div class='alert alert-info alert-block'>
 | 
					{% endblock page_info %}
 | 
				
			||||||
            <strong>{% trans "Requirements for BOM upload" %}:</strong>
 | 
					 | 
				
			||||||
            <ul>
 | 
					 | 
				
			||||||
                <li>{% trans "The BOM file must contain the required named columns as provided in the " %} <strong><a href="/part/bom_template/">{% trans "BOM Upload Template" %}</a></strong></li>
 | 
					 | 
				
			||||||
                <li>{% trans "Each part must already exist in the database" %}</li>
 | 
					 | 
				
			||||||
            </ul>
 | 
					 | 
				
			||||||
        </div>
 | 
					 | 
				
			||||||
        {% endblock %} 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        <table class='table table-striped' style='margin-top: 12px; margin-bottom: 0px'>
 | 
					 | 
				
			||||||
        {{ wizard.management_form }}
 | 
					 | 
				
			||||||
        {% block form_content %}
 | 
					 | 
				
			||||||
        {% crispy wizard.form %}
 | 
					 | 
				
			||||||
        {% endblock form_content %}
 | 
					 | 
				
			||||||
        </table>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        {% block form_buttons_bottom %}
 | 
					 | 
				
			||||||
        {% if wizard.steps.prev %}
 | 
					 | 
				
			||||||
        <button name="wizard_goto_step" type="submit" value="{{ wizard.steps.prev }}" class="save btn btn-outline-secondary">{% trans "Previous Step" %}</button>
 | 
					 | 
				
			||||||
        {% endif %}
 | 
					 | 
				
			||||||
        <button type="submit" class="save btn btn-outline-secondary">{% trans "Upload File" %}</button>
 | 
					 | 
				
			||||||
        </form>
 | 
					 | 
				
			||||||
        {% endblock form_buttons_bottom %}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        {% endblock details %}
 | 
					 | 
				
			||||||
    </div>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
{% endblock page_content %}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% block js_ready %}
 | 
					{% block js_ready %}
 | 
				
			||||||
{{ block.super }}
 | 
					{{ block.super }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					enableSidebar('bom-upload');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% endblock js_ready %}
 | 
					{% endblock js_ready %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -210,7 +210,8 @@
 | 
				
			|||||||
                {% else %}
 | 
					                {% else %}
 | 
				
			||||||
                parent: null,
 | 
					                parent: null,
 | 
				
			||||||
                {% endif %}
 | 
					                {% endif %}
 | 
				
			||||||
            }
 | 
					            },
 | 
				
			||||||
 | 
					            allowTreeView: true,
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -20,13 +20,6 @@
 | 
				
			|||||||
        <!-- Details Table -->
 | 
					        <!-- Details Table -->
 | 
				
			||||||
        <table class="table table-striped table-condensed">
 | 
					        <table class="table table-striped table-condensed">
 | 
				
			||||||
            <col width='25'>
 | 
					            <col width='25'>
 | 
				
			||||||
            {% if part.IPN %}
 | 
					 | 
				
			||||||
            <tr>
 | 
					 | 
				
			||||||
                <td><span class='fas fa-tag'></span></td>
 | 
					 | 
				
			||||||
                <td>{% trans "IPN" %}</td>
 | 
					 | 
				
			||||||
                <td>{{ part.IPN }}{% include "clip.html"%}</td>
 | 
					 | 
				
			||||||
            </tr>
 | 
					 | 
				
			||||||
            {% endif %}
 | 
					 | 
				
			||||||
            <tr>
 | 
					            <tr>
 | 
				
			||||||
                <td><span class='fas fa-shapes'></span></td>
 | 
					                <td><span class='fas fa-shapes'></span></td>
 | 
				
			||||||
                <td>{% trans "Name" %}</td>
 | 
					                <td>{% trans "Name" %}</td>
 | 
				
			||||||
@@ -37,6 +30,22 @@
 | 
				
			|||||||
                <td>{% trans "Description" %}</td>
 | 
					                <td>{% trans "Description" %}</td>
 | 
				
			||||||
                <td>{{ part.description }}{% include "clip.html"%}</td>
 | 
					                <td>{{ part.description }}{% include "clip.html"%}</td>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
 | 
					            {% if part.category %}
 | 
				
			||||||
 | 
					            <tr>
 | 
				
			||||||
 | 
					                <td><span class='fas fa-sitemap'></span></td>
 | 
				
			||||||
 | 
					                <td>{% trans "Category" %}</td>
 | 
				
			||||||
 | 
					                <td>
 | 
				
			||||||
 | 
					                    <a href='{% url "category-detail" part.category.pk %}'>{{ part.category }}</a>
 | 
				
			||||||
 | 
					                </td>
 | 
				
			||||||
 | 
					            </tr>
 | 
				
			||||||
 | 
					            {% endif %}
 | 
				
			||||||
 | 
					            {% if part.IPN %}
 | 
				
			||||||
 | 
					            <tr>
 | 
				
			||||||
 | 
					                <td><span class='fas fa-tag'></span></td>
 | 
				
			||||||
 | 
					                <td>{% trans "IPN" %}</td>
 | 
				
			||||||
 | 
					                <td>{{ part.IPN }}{% include "clip.html"%}</td>
 | 
				
			||||||
 | 
					            </tr>
 | 
				
			||||||
 | 
					            {% endif %}
 | 
				
			||||||
            {% if part.revision %}
 | 
					            {% if part.revision %}
 | 
				
			||||||
            <tr>
 | 
					            <tr>
 | 
				
			||||||
                <td><span class='fas fa-code-branch'></span></td>
 | 
					                <td><span class='fas fa-code-branch'></span></td>
 | 
				
			||||||
@@ -44,6 +53,20 @@
 | 
				
			|||||||
                <td>{{ part.revision }}{% include "clip.html"%}</td>
 | 
					                <td>{{ part.revision }}{% include "clip.html"%}</td>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
            {% endif %}
 | 
					            {% endif %}
 | 
				
			||||||
 | 
					            {% if part.units %}
 | 
				
			||||||
 | 
					            <tr>
 | 
				
			||||||
 | 
					                <td></td>
 | 
				
			||||||
 | 
					                <td>{% trans "Units" %}</td>
 | 
				
			||||||
 | 
					                <td>{{ part.units }}</td>
 | 
				
			||||||
 | 
					            </tr>
 | 
				
			||||||
 | 
					            {% endif %}
 | 
				
			||||||
 | 
					            {% if part.minimum_stock %}
 | 
				
			||||||
 | 
					            <tr>
 | 
				
			||||||
 | 
					                <td><span class='fas fa-less-than-equal'></span></td>
 | 
				
			||||||
 | 
					                <td>{% trans "Minimum stock level" %}</td>
 | 
				
			||||||
 | 
					                <td>{{ part.minimum_stock }}</td>
 | 
				
			||||||
 | 
					            </tr>
 | 
				
			||||||
 | 
					            {% endif %}
 | 
				
			||||||
            {% if part.keywords %}
 | 
					            {% if part.keywords %}
 | 
				
			||||||
            <tr>
 | 
					            <tr>
 | 
				
			||||||
                <td><span class='fas fa-key'></span></td>
 | 
					                <td><span class='fas fa-key'></span></td>
 | 
				
			||||||
@@ -64,7 +87,7 @@
 | 
				
			|||||||
                <td>
 | 
					                <td>
 | 
				
			||||||
                    {{ part.creation_date }}
 | 
					                    {{ part.creation_date }}
 | 
				
			||||||
                    {% if part.creation_user %}
 | 
					                    {% if part.creation_user %}
 | 
				
			||||||
                    <span class='badge'>{{ part.creation_user }}</span>
 | 
					                    <span class='badge badge-right rounded-pill bg-dark'>{{ part.creation_user }}</span>
 | 
				
			||||||
                    {% endif %}
 | 
					                    {% endif %}
 | 
				
			||||||
                </td>
 | 
					                </td>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
@@ -79,7 +102,9 @@
 | 
				
			|||||||
            <tr>
 | 
					            <tr>
 | 
				
			||||||
                <td><span class='fas fa-search-location'></span></td>
 | 
					                <td><span class='fas fa-search-location'></span></td>
 | 
				
			||||||
                <td>{% trans "Default Location" %}</td>
 | 
					                <td>{% trans "Default Location" %}</td>
 | 
				
			||||||
                <td>{{ part.default_location }}</td>
 | 
					                <td>
 | 
				
			||||||
 | 
					                    <a href='{% url "stock-location-detail" part.default_location.pk %}'>{{ part.default_location }}</a>
 | 
				
			||||||
 | 
					                </td>
 | 
				
			||||||
            </tr>
 | 
					            </tr>
 | 
				
			||||||
            {% endif %}
 | 
					            {% endif %}
 | 
				
			||||||
            {% if part.default_supplier %}
 | 
					            {% if part.default_supplier %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -393,7 +393,7 @@
 | 
				
			|||||||
        <td><span class='fas fa-calendar-alt'></span></td>
 | 
					        <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 badge-right rounded-pill bg-dark'>{{ item.stocktake_user }}</span></td>
 | 
				
			||||||
        {% else %}
 | 
					        {% else %}
 | 
				
			||||||
        <td><em>{% trans "No stocktake performed" %}</em></td>
 | 
					        <td><em>{% trans "No stocktake performed" %}</em></td>
 | 
				
			||||||
        {% endif %}
 | 
					        {% endif %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -183,7 +183,8 @@
 | 
				
			|||||||
            {% else %}
 | 
					            {% else %}
 | 
				
			||||||
            parent: 'null',
 | 
					            parent: 'null',
 | 
				
			||||||
            {% endif %}
 | 
					            {% endif %}
 | 
				
			||||||
        }
 | 
					        },
 | 
				
			||||||
 | 
					        allowTreeView: true,
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
    linkButtonsToSelection(
 | 
					    linkButtonsToSelection(
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -36,7 +36,7 @@ If this location is deleted, these items will be moved to the top level 'Stock'
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<ul class='list-group'>
 | 
					<ul class='list-group'>
 | 
				
			||||||
    {% for item in location.stock_items.all %}
 | 
					    {% for item in location.stock_items.all %}
 | 
				
			||||||
    <li class='list-group-item'><strong>{{ item.part.full_name }}</strong> - <em>{{ item.part.description }}</em><span class='badge'>{% decimal item.quantity %}</span></li>
 | 
					    <li class='list-group-item'><strong>{{ item.part.full_name }}</strong> - <em>{{ item.part.description }}</em><span class='badge badge-right rounded-pill bg-dark'>{% decimal item.quantity %}</span></li>
 | 
				
			||||||
    {% endfor %}
 | 
					    {% endfor %}
 | 
				
			||||||
</ul>
 | 
					</ul>
 | 
				
			||||||
{% endif %}
 | 
					{% endif %}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										43
									
								
								InvenTree/templates/email/email.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								InvenTree/templates/email/email.html
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
				
			|||||||
 | 
					{% load i18n %}
 | 
				
			||||||
 | 
					{% load static %}
 | 
				
			||||||
 | 
					{% load inventree_extras %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<table style='border-collapse: collapse; width: 85%; margin-left: 10%; font-size: 1rem; border: 1px solid #68686a; border-radius: 2px;'>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    {% block header %}
 | 
				
			||||||
 | 
					    <tr style='background: #eef3f7; height: 4rem; text-align: center;'>
 | 
				
			||||||
 | 
					        <th colspan="100%" style="padding-bottom: 1rem; color: #68686a;">
 | 
				
			||||||
 | 
					            {% block header_row %}
 | 
				
			||||||
 | 
					            <p style='font-size: 1.25rem;'>{% block title %}<!-- email title goes here -->{% endblock %}</p>
 | 
				
			||||||
 | 
					            {% block subtitle %}
 | 
				
			||||||
 | 
					            <!-- email subtitle goes here -->
 | 
				
			||||||
 | 
					            {% endblock %}
 | 
				
			||||||
 | 
					            {% endblock %}
 | 
				
			||||||
 | 
					        </th>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    {% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    {% block body %}
 | 
				
			||||||
 | 
					    <tr style="height: 3rem; border-bottom: 1px solid #68686a;">
 | 
				
			||||||
 | 
					        {% block body_row %}
 | 
				
			||||||
 | 
					        <!-- email body goes here -->
 | 
				
			||||||
 | 
					        {% endblock %}
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    {% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    {% block footer %}
 | 
				
			||||||
 | 
					    <tr style='background: #eef3f7; height: 2rem;'>
 | 
				
			||||||
 | 
					        <td colspan="100%" style="padding-top:1rem; text-align: center">
 | 
				
			||||||
 | 
					            {% block footer_prefix %}
 | 
				
			||||||
 | 
					            <!-- Custom footer information goes here -->
 | 
				
			||||||
 | 
					            {% endblock %}
 | 
				
			||||||
 | 
					            <p><em><small>{% trans "InvenTree version" %}: {% inventree_version %} - <a href='https://inventree.readthedocs.io'>inventree.readthedocs.io</a></small></em></p>
 | 
				
			||||||
 | 
					            {% block footer_suffix %}
 | 
				
			||||||
 | 
					            <!-- Custom footer information goes here -->
 | 
				
			||||||
 | 
					            {% endblock %}
 | 
				
			||||||
 | 
					        </td>
 | 
				
			||||||
 | 
					    </tr>
 | 
				
			||||||
 | 
					    {% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					</table>
 | 
				
			||||||
@@ -1,35 +1,29 @@
 | 
				
			|||||||
 | 
					{% extends "email/email.html" %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% load i18n %}
 | 
					{% load i18n %}
 | 
				
			||||||
{% load inventree_extras %}
 | 
					{% load inventree_extras %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<table style="border-collapse:collapse; width: 80%;margin-left: 10%; font-size: 1rem">
 | 
					{% block title %}
 | 
				
			||||||
 | 
					{% blocktrans with part=part.name %} The available stock for {{ part }} has fallen below the configured minimum level{% endblocktrans %}
 | 
				
			||||||
 | 
					{% if link %}
 | 
				
			||||||
 | 
					<p>{% trans "Click on the following link to view this part" %}: <a href="{{ link }}">{{ link }}</a></p>
 | 
				
			||||||
 | 
					{% endif %}
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <tr style="background: aliceblue; height: 4rem;">
 | 
					{% block subtitle %}
 | 
				
			||||||
        <th colspan="3" style="padding-bottom: 1rem; font-size: 1.25rem; color:rgb(210, 20, 20)">
 | 
					<p><em>{% blocktrans with part=part.name %}You are receiving this email because you are subscribed to notifications for this part {% endblocktrans %}.</em></p>
 | 
				
			||||||
            <p>{% blocktrans with part=part.name %} The available stock for {{ part }} has fallen below the configured minimum level{% endblocktrans %}</p> 
 | 
					{% endblock %}
 | 
				
			||||||
            {% if link %}
 | 
					 | 
				
			||||||
            <p>{% trans "Click on the following link to view this part" %}: <a href="{{ link }}">{{ link }}</a></p>
 | 
					 | 
				
			||||||
            {% endif %}
 | 
					 | 
				
			||||||
        </th>
 | 
					 | 
				
			||||||
    </tr>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <tr style="height: 3rem; border-bottom: 1px solid">
 | 
					{% block body %}
 | 
				
			||||||
        <th>{% trans "Part Name" %}</th>
 | 
					<tr style="height: 3rem; border-bottom: 1px solid">
 | 
				
			||||||
        <th>{% trans "Available Quantity" %}</th>
 | 
					    <th>{% trans "Part Name" %}</th>
 | 
				
			||||||
        <th>{% trans "Minimum Quantity" %}</th>
 | 
					    <th>{% trans "Available Quantity" %}</th>
 | 
				
			||||||
    </tr>
 | 
					    <th>{% trans "Minimum Quantity" %}</th>
 | 
				
			||||||
 | 
					</tr>
 | 
				
			||||||
    <tr style="height: 3rem">
 | 
					 | 
				
			||||||
        <td style="text-align: center;">{{ part.full_name }}</td>
 | 
					 | 
				
			||||||
        <td style="text-align: center;">{{ part.total_stock }}</td>
 | 
					 | 
				
			||||||
        <td style="text-align: center;">{{ part.minimum_stock }}</td>
 | 
					 | 
				
			||||||
    </tr>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    <tr style="background-color: aliceblue;height: 4rem;">
 | 
					 | 
				
			||||||
        <td colspan="3" style="padding-top:1rem; text-align: center">
 | 
					 | 
				
			||||||
            <p><em>{% blocktrans with part=part.name %}You are receiving this email because you are subscribed to notifications for this part {% endblocktrans %}.</em></p>
 | 
					 | 
				
			||||||
            <p><em><small>{% trans "InvenTree version" %}: {% inventree_version %}</small></em></p>
 | 
					 | 
				
			||||||
        </td>
 | 
					 | 
				
			||||||
    </tr>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
</table>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<tr style="height: 3rem">
 | 
				
			||||||
 | 
					    <td style="text-align: center;">{{ part.full_name }}</td>
 | 
				
			||||||
 | 
					    <td style="text-align: center;">{{ part.total_stock }}</td>
 | 
				
			||||||
 | 
					    <td style="text-align: center;">{{ part.minimum_stock }}</td>
 | 
				
			||||||
 | 
					</tr>
 | 
				
			||||||
 | 
					{% endblock %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1133,8 +1133,10 @@ function loadPartTable(table, url, options={}) {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Display a table of part categories
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
function loadPartCategoryTable(table, options) {
 | 
					function loadPartCategoryTable(table, options) {
 | 
				
			||||||
    /* Display a table of part categories */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var params = options.params || {};
 | 
					    var params = options.params || {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1157,15 +1159,15 @@ function loadPartCategoryTable(table, options) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    setupFilterList(filterKey, table, filterListElement);
 | 
					    setupFilterList(filterKey, table, filterListElement);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var tree_view = inventreeLoad('category-tree-view') == 1;
 | 
					    var tree_view = options.allowTreeView && inventreeLoad('category-tree-view') == 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    table.inventreeTable({
 | 
					    table.inventreeTable({
 | 
				
			||||||
        treeEnable: tree_view,
 | 
					        treeEnable: tree_view,
 | 
				
			||||||
        rootParentId: options.params.parent,
 | 
					        rootParentId: tree_view ? options.params.parent : null,
 | 
				
			||||||
        uniqueId: 'pk',
 | 
					        uniqueId: 'pk',
 | 
				
			||||||
        idField: 'pk',
 | 
					        idField: 'pk',
 | 
				
			||||||
        treeShowField: 'name',
 | 
					        treeShowField: 'name',
 | 
				
			||||||
        parentIdField: 'parent',
 | 
					        parentIdField: tree_view ? 'parent' : null,
 | 
				
			||||||
        method: 'get',
 | 
					        method: 'get',
 | 
				
			||||||
        url: options.url || '{% url "api-part-category-list" %}',
 | 
					        url: options.url || '{% url "api-part-category-list" %}',
 | 
				
			||||||
        queryParams: filters,
 | 
					        queryParams: filters,
 | 
				
			||||||
@@ -1176,7 +1178,7 @@ function loadPartCategoryTable(table, options) {
 | 
				
			|||||||
        name: 'category',
 | 
					        name: 'category',
 | 
				
			||||||
        original: original,
 | 
					        original: original,
 | 
				
			||||||
        showColumns: true,
 | 
					        showColumns: true,
 | 
				
			||||||
        buttons: [
 | 
					        buttons: options.allowTreeView ? [
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                icon: 'fas fa-bars',
 | 
					                icon: 'fas fa-bars',
 | 
				
			||||||
                attributes: {
 | 
					                attributes: {
 | 
				
			||||||
@@ -1215,28 +1217,31 @@ function loadPartCategoryTable(table, options) {
 | 
				
			|||||||
                    );
 | 
					                    );
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        ],
 | 
					        ] : [],
 | 
				
			||||||
        onPostBody: function() {
 | 
					        onPostBody: function() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            tree_view = inventreeLoad('category-tree-view') == 1;
 | 
					            if (options.allowTreeView) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (tree_view) {
 | 
					                tree_view = inventreeLoad('category-tree-view') == 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                $('#view-category-list').removeClass('btn-secondary').addClass('btn-outline-secondary');
 | 
					                if (tree_view) {
 | 
				
			||||||
                $('#view-category-tree').removeClass('btn-outline-secondary').addClass('btn-secondary');
 | 
					
 | 
				
			||||||
                
 | 
					                    $('#view-category-list').removeClass('btn-secondary').addClass('btn-outline-secondary');
 | 
				
			||||||
                table.treegrid({
 | 
					                    $('#view-category-tree').removeClass('btn-outline-secondary').addClass('btn-secondary');
 | 
				
			||||||
                    treeColumn: 0,
 | 
					                    
 | 
				
			||||||
                    onChange: function() {
 | 
					                    table.treegrid({
 | 
				
			||||||
                        table.bootstrapTable('resetView');
 | 
					                        treeColumn: 0,
 | 
				
			||||||
                    },
 | 
					                        onChange: function() {
 | 
				
			||||||
                    onExpand: function() {
 | 
					                            table.bootstrapTable('resetView');
 | 
				
			||||||
                        
 | 
					                        },
 | 
				
			||||||
                    }
 | 
					                        onExpand: function() {
 | 
				
			||||||
                });
 | 
					                            
 | 
				
			||||||
            } else {
 | 
					                        }
 | 
				
			||||||
                $('#view-category-tree').removeClass('btn-secondary').addClass('btn-outline-secondary');
 | 
					                    });
 | 
				
			||||||
                $('#view-category-list').removeClass('btn-outline-secondary').addClass('btn-secondary');
 | 
					                } else {
 | 
				
			||||||
 | 
					                    $('#view-category-tree').removeClass('btn-secondary').addClass('btn-outline-secondary');
 | 
				
			||||||
 | 
					                    $('#view-category-list').removeClass('btn-outline-secondary').addClass('btn-secondary');
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        columns: [
 | 
					        columns: [
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1416,8 +1416,11 @@ function loadStockTable(table, options) {
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* 
 | 
				
			||||||
 | 
					 * Display a table of stock locations
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
function loadStockLocationTable(table, options) {
 | 
					function loadStockLocationTable(table, options) {
 | 
				
			||||||
    /* Display a table of stock locations */
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var params = options.params || {};
 | 
					    var params = options.params || {};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -1443,15 +1446,15 @@ function loadStockLocationTable(table, options) {
 | 
				
			|||||||
        filters[key] = params[key];
 | 
					        filters[key] = params[key];
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    var tree_view = inventreeLoad('location-tree-view') == 1;
 | 
					    var tree_view = options.allowTreeView && inventreeLoad('location-tree-view') == 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    table.inventreeTable({
 | 
					    table.inventreeTable({
 | 
				
			||||||
        treeEnable: tree_view,
 | 
					        treeEnable: tree_view,
 | 
				
			||||||
        rootParentId: options.params.parent,
 | 
					        rootParentId: tree_view ? options.params.parent : null,
 | 
				
			||||||
        uniqueId: 'pk',
 | 
					        uniqueId: 'pk',
 | 
				
			||||||
        idField: 'pk',
 | 
					        idField: 'pk',
 | 
				
			||||||
        treeShowField: 'name',
 | 
					        treeShowField: 'name',
 | 
				
			||||||
        parentIdField: 'parent',
 | 
					        parentIdField: tree_view ? 'parent' : null,
 | 
				
			||||||
        disablePagination: tree_view,
 | 
					        disablePagination: tree_view,
 | 
				
			||||||
        sidePagination: tree_view ? 'client' : 'server',
 | 
					        sidePagination: tree_view ? 'client' : 'server',
 | 
				
			||||||
        serverSort: !tree_view,
 | 
					        serverSort: !tree_view,
 | 
				
			||||||
@@ -1465,28 +1468,31 @@ function loadStockLocationTable(table, options) {
 | 
				
			|||||||
        showColumns: true,
 | 
					        showColumns: true,
 | 
				
			||||||
        onPostBody: function() {
 | 
					        onPostBody: function() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            tree_view = inventreeLoad('location-tree-view') == 1;
 | 
					            if (options.allowTreeView) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (tree_view) {
 | 
					                tree_view = inventreeLoad('location-tree-view') == 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                $('#view-location-list').removeClass('btn-secondary').addClass('btn-outline-secondary');
 | 
					                if (tree_view) {
 | 
				
			||||||
                $('#view-location-tree').removeClass('btn-outline-secondary').addClass('btn-secondary');
 | 
					
 | 
				
			||||||
                
 | 
					                    $('#view-location-list').removeClass('btn-secondary').addClass('btn-outline-secondary');
 | 
				
			||||||
                table.treegrid({
 | 
					                    $('#view-location-tree').removeClass('btn-outline-secondary').addClass('btn-secondary');
 | 
				
			||||||
                    treeColumn: 1,
 | 
					                    
 | 
				
			||||||
                    onChange: function() {
 | 
					                    table.treegrid({
 | 
				
			||||||
                        table.bootstrapTable('resetView');
 | 
					                        treeColumn: 1,
 | 
				
			||||||
                    },
 | 
					                        onChange: function() {
 | 
				
			||||||
                    onExpand: function() {
 | 
					                            table.bootstrapTable('resetView');
 | 
				
			||||||
                        
 | 
					                        },
 | 
				
			||||||
                    }
 | 
					                        onExpand: function() {
 | 
				
			||||||
                });
 | 
					                            
 | 
				
			||||||
            } else {
 | 
					                        }
 | 
				
			||||||
                $('#view-location-tree').removeClass('btn-secondary').addClass('btn-outline-secondary');
 | 
					                    });
 | 
				
			||||||
                $('#view-location-list').removeClass('btn-outline-secondary').addClass('btn-secondary');
 | 
					                } else {
 | 
				
			||||||
 | 
					                    $('#view-location-tree').removeClass('btn-secondary').addClass('btn-outline-secondary');
 | 
				
			||||||
 | 
					                    $('#view-location-list').removeClass('btn-outline-secondary').addClass('btn-secondary');
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        buttons: [
 | 
					        buttons: options.allowTreeView ? [
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                icon: 'fas fa-bars',
 | 
					                icon: 'fas fa-bars',
 | 
				
			||||||
                attributes: {
 | 
					                attributes: {
 | 
				
			||||||
@@ -1525,7 +1531,7 @@ function loadStockLocationTable(table, options) {
 | 
				
			|||||||
                    );
 | 
					                    );
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        ],
 | 
					        ] : [],
 | 
				
			||||||
        columns: [
 | 
					        columns: [
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                checkbox: true,
 | 
					                checkbox: true,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user