From 1791dce8102e3a9e98bd57168c13cc6c275e4a33 Mon Sep 17 00:00:00 2001 From: eLBati Date: Wed, 8 Jul 2020 16:00:00 +0200 Subject: [PATCH] [PR #463] [IMP] helpdesk_mgmt: Show attachments on portal's ticket view Forward port of 656c2d933586fcb08a50488ee5b0cd27b56dfe03 Note that the commit fc3905eaa2330e7d70714f9a614eb2b48d4d173f (allow portal users to write tickets) has not been forward ported as it is not necessary --- helpdesk_mgmt/controllers/myaccount.py | 11 +++++++ .../views/helpdesk_ticket_templates.xml | 31 ++++++++++++++----- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/helpdesk_mgmt/controllers/myaccount.py b/helpdesk_mgmt/controllers/myaccount.py index 7772bb306b..7f0bfa0d71 100644 --- a/helpdesk_mgmt/controllers/myaccount.py +++ b/helpdesk_mgmt/controllers/myaccount.py @@ -113,10 +113,21 @@ def _ticket_get_page_view_values(self, ticket, **kwargs): closed_stages = request.env["helpdesk.ticket.stage"].search( [("closed", "=", True)] ) + files = ( + request.env["ir.attachment"] + .sudo() + .search( + [ + ("res_model", "=", "helpdesk.ticket"), + ("res_id", "=", ticket.id), + ] + ) + ) values = { "page_name": "ticket", "ticket": ticket, "closed_stages": closed_stages, + "files": files, } if kwargs.get("error"): diff --git a/helpdesk_mgmt/views/helpdesk_ticket_templates.xml b/helpdesk_mgmt/views/helpdesk_ticket_templates.xml index c4f658a585..832a95934f 100644 --- a/helpdesk_mgmt/views/helpdesk_ticket_templates.xml +++ b/helpdesk_mgmt/views/helpdesk_ticket_templates.xml @@ -54,14 +54,14 @@

Tickets - - -

+ Last Stage Update:
+ Attachments: +
+ + + + + + +
+
+
+ + +
+
+ +
-
-
- - -