{% extends "base.html" %} {% load static %} {% load i18n %} {% load crispy_forms_tags %} {% block content %}

{% trans "Invoices list" %}

{% csrf_token %} {# Render the invoice form #} {% crispy form %} {# The next part concerns the product formset #} {# Generate some hidden fields that manage the number of products, and make easier the parsing #} {{ formset.management_form }} {# Fill initial data #} {% for form in formset %} {% if forloop.first %} {% endif %} {# These fields are hidden but handled by the formset to link the id and the invoice id #} {{ form.invoice }} {{ form.id }} {% endfor %}
{{ form.designation.label }}* {{ form.quantity.label }}* {{ form.amount.label }}*
{{ form.designation }} {{ form.quantity }} {{ form.amount }}
{# Display buttons to add and remove products #}
{% endblock %} {% block extrajavascript %} {% endblock %}