- Can't edit build status directly
- Refresh BOM table on reload
- Hide Company tabs that are not yet functional
This commit is contained in:
Oliver Walters 2019-04-30 20:55:28 +10:00
parent fb89574c42
commit 7e7ac60a1a
4 changed files with 34 additions and 27 deletions

View File

@ -23,8 +23,6 @@ class EditBuildForm(HelperForm):
'batch', 'batch',
'URL', 'URL',
'notes', 'notes',
'status',
# 'completion_date',
] ]

View File

@ -6,11 +6,13 @@
<li{% if tab == 'parts' %} class='active'{% endif %}> <li{% if tab == 'parts' %} class='active'{% endif %}>
<a href="{% url 'company-detail-parts' company.id %}">Supplier Parts <span class='badge'>{{ company.part_count }}</span></a> <a href="{% url 'company-detail-parts' company.id %}">Supplier Parts <span class='badge'>{{ company.part_count }}</span></a>
</li> </li>
{% if 0 %}
<li{% if tab == 'po' %} class='active'{% endif %}> <li{% if tab == 'po' %} class='active'{% endif %}>
<a href="#">Purchase Orders</a> <a href="#">Purchase Orders</a>
</li> </li>
{% endif %} {% endif %}
{% if company.is_customer %} {% endif %}
{% if company.is_customer and 0 %}
<li{% if tab == 'co' %} class='active'{% endif %}> <li{% if tab == 'co' %} class='active'{% endif %}>
<a href="#">Sales Orders</a> <a href="#">Sales Orders</a>
</li> </li>

View File

@ -60,7 +60,14 @@
}); });
$("#bom-item-new").click(function () { $("#bom-item-new").click(function () {
launchModalForm("{% url 'bom-item-create' %}?parent={{ part.id }}", {}); launchModalForm(
"{% url 'bom-item-create' %}?parent={{ part.id }}",
{
success: function() {
$("#bom-table").bootstrapTable('refresh');
}
}
);
}); });
{% else %} {% else %}

View File

@ -114,16 +114,6 @@ function loadBomTable(table, options) {
} }
); );
// Part notes
cols.push(
{
field: 'note',
title: 'Notes',
searchable: true,
sortable: false,
}
);
if (options.editable) { if (options.editable) {
cols.push({ cols.push({
formatter: function(value, row, index, field) { formatter: function(value, row, index, field) {
@ -156,18 +146,28 @@ function loadBomTable(table, options) {
return renderLink(text, row.sub_part.url + "stock/"); return renderLink(text, row.sub_part.url + "stock/");
} }
} }
);
}
// Part notes
cols.push(
{
field: 'note',
title: 'Notes',
searchable: true,
sortable: false,
}
); );
}
// Configure the table (bootstrap-table) // Configure the table (bootstrap-table)
table.bootstrapTable({ table.bootstrapTable({
sortable: true, sortable: true,
search: true, search: true,
clickToSelect: true, clickToSelect: true,
queryParams: function(p) { queryParams: function(p) {
return { return {
part: options.parent_id, part: options.parent_id,
} }
}, },
columns: cols, columns: cols,