diff --git a/controllers/main.py b/controllers/main.py
index 77172fdb52a3fc2996fed56c862ce9e9af854a10..184ccceb5c84838f3efe25a7874f85c35f452f91 100644
--- a/controllers/main.py
+++ b/controllers/main.py
@@ -29,6 +29,8 @@ class CustomerPortal(CustomerPortal):
             response = Response()
             response.data = base64.b64decode(contract.document)
             response.mimetype = "application/pdf"
+            fn = contract.name
+            response.headers['Content-Disposition'] = 'inline; filename="' + fn + '"'
             return response
 
     @http.route(
diff --git a/templates/operation_templates_page.xml b/templates/operation_templates_page.xml
index 57ebf463f91b32ed1d571d66449e9f0abf0e3dac..3766b7d51c3134480c08b5162a2da506099eabf2 100644
--- a/templates/operation_templates_page.xml
+++ b/templates/operation_templates_page.xml
@@ -74,9 +74,7 @@
                                             </a>
                                         </td>
                                         <td t-att-data-order="c.date_app">
-                                            <t
-                                                t-out="c.date_app.strftime('%d/%m/%Y')"
-                                            />
+                                            <t t-out="c.date_app.strftime('%d/%m/%Y') if c.date_app else ''" />
                                         </td>
                                         <td>
                                             <t t-out="c.name" />