{% extends "part/part_base.html" %}
{% load static %}
{% block details %}
{% include 'part/tabs.html' with tab='detail' %}
Buildable |
{% include "yesnolabel.html" with value=part.buildable %} |
Consumable |
{% include "yesnolabel.html" with value=part.consumable %} |
Trackable |
{% include "yesnolabel.html" with value=part.trackable %} |
Purchaseable |
{% include "yesnolabel.html" with value=part.purchaseable %} |
Salable |
{% include "yesnolabel.html" with value=part.salable %} |
{% if part.minimum_stock > 0 %}
Minimum Stock |
{{ part.minimum_stock }} |
{% endif %}
{% if part.notes %}
{% endif %}
{% endblock %}
{% block js_load %}
{{ block.super }}
{% endblock %}
{% block js_ready %}
{{ block.super }}
$("#duplicate-part").click(function() {
launchModalForm(
"{% url 'part-create' %}",
{
follow: true,
data: {
copy: {{ part.id }},
},
}
);
});
$("#edit-part").click(function() {
launchModalForm(
"{% url 'part-edit' part.id %}",
{
reload: true,
});
});
$('#delete-part').click(function() {
launchDeleteForm(
"{% url 'part-delete' part.id %}",
{
redirect: {% if part.category %}"{% url 'category-detail' part.category.id %}"{% else %}"{% url 'part-index' %}"{% endif %}
});
});
$('#stocktake-part').click(function() {
adjustStock({
action: 'stocktake',
query: {
part: {{ part.id }},
},
success: function() {
location.reload();
}
});
});
{% endblock %}