Browse Source

Add a button on invice change form to download it as pdf

Fabs 11 years ago
parent
commit
31703fe65f
2 changed files with 10 additions and 1 deletions
  1. 1 1
      coin/billing/urls.py
  2. 9 0
      coin/templates/admin/billing/invoice/change_form.html

+ 1 - 1
coin/billing/urls.py

@@ -4,5 +4,5 @@ from coin.billing import views
 
 urlpatterns = patterns(
     '',
-    url(r'^invoice/(?P<id>.+)/pdf$', views.invoice_pdf)
+    url(r'^invoice/(?P<id>.+)/pdf$', views.invoice_pdf, name="invoice_pdf")
 )

+ 9 - 0
coin/templates/admin/billing/invoice/change_form.html

@@ -0,0 +1,9 @@
+{% extends "admin/change_form.html" %}
+{% load url from future %}
+{% block object-tools %}
+{% if change %}{% if not is_popup %}
+<ul class="object-tools">
+   <li><a href="{% url 'billing:invoice_pdf' id=86 %}">Télécharger en PDF</a></li>
+</ul>
+{% endif %}{% endif %}
+{% endblock %}