2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-04 20:51:00 +00:00

Include 'default' value in OPTIONS request for any fields with specified default values

This commit is contained in:
Oliver
2021-06-27 21:44:21 +10:00
parent 67f76c8bca
commit d80948369b
3 changed files with 61 additions and 6 deletions

View File

@ -15,10 +15,13 @@
{% if pagetype == 'manufacturers' and roles.purchase_order.add or pagetype == 'suppliers' and roles.purchase_order.add or pagetype == 'customers' and roles.sales_order.add %}
<div id='button-toolbar'>
<button type='button' class="btn btn-success" id='new-company'>
<span class='fas fa-plus-circle'></span> {{ button_text }} (Server Side)
</button>
<button type='button' class="btn btn-success" id='new-company-2'>
<span class='fas fa-plus-circle'></span> {{ button_text }} (Client Side)
</button>
<div class='btn-group'>
<button type='button' class="btn btn-success" id='new-company'>
<span class='fas fa-plus-circle'></span> {{ button_text }}
</button>
</div>
</div>
{% endif %}
@ -35,6 +38,22 @@
});
});
$('#new-company-2').click(function() {
constructForm(
'{% url "api-company-list" %}',
{
method: 'POST',
fields: [
'name',
'description',
'is_supplier',
'is_manufacturer',
'is_customer',
]
}
);
});
loadCompanyTable("#company-table", "{% url 'api-company-list' %}",
{
pagetype: '{{ pagetype }}',