Adds button to sales order page to export to file

This commit is contained in:
Oliver 2021-10-07 13:21:30 +11:00
parent 996ccbe5bd
commit d391c5059b
2 changed files with 10 additions and 1 deletions

View File

@ -224,7 +224,7 @@ $("#cancel-order").click(function() {
});
$("#export-order").click(function() {
location.href = "{% url 'po-export' order.id %}";
location.href = '{% url "po-export" order.id %}';
});

View File

@ -50,6 +50,9 @@ src="{% static 'img/blank_image.png' %}"
<button type='button' class='btn btn-default' id='print-order-report' title='{% trans "Print" %}'>
<span class='fas fa-print'></span>
</button>
<button type='button' class='btn btn-default' id='export-order' title='{% trans "Export order to file" %}'>
<span class='fas fa-file-download'></span>
</button>
{% if roles.sales_order.change %}
<button type='button' class='btn btn-default' id='edit-order' title='{% trans "Edit order information" %}'>
<span class='fas fa-edit icon-green'></span>
@ -63,9 +66,11 @@ src="{% static 'img/blank_image.png' %}"
</button>
{% endif %}
{% endif %}
<!--
<button type='button' disabled='' class='btn btn-default' id='packing-list' title='{% trans "Packing List" %}'>
<span class='fas fa-clipboard-list'></span>
</button>
-->
</div>
</div>
{% endblock %}
@ -196,4 +201,8 @@ $('#print-order-report').click(function() {
printSalesOrderReports([{{ order.pk }}]);
});
$('#export-order').click(function() {
location.href = '{% url "so-export" order.id %}';
});
{% endblock %}