+ This module is maintained by the OCA.
+ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
+ To contribute to this module, please visit http://odoo-community.org.
+
+
+
+
+
diff --git a/helpdesk_ticket_partner_response/tests/__init__.py b/helpdesk_ticket_partner_response/tests/__init__.py
new file mode 100644
index 0000000000..189e05392b
--- /dev/null
+++ b/helpdesk_ticket_partner_response/tests/__init__.py
@@ -0,0 +1,3 @@
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+
+from . import test_partner_response
diff --git a/helpdesk_ticket_partner_response/tests/test_partner_response.py b/helpdesk_ticket_partner_response/tests/test_partner_response.py
new file mode 100644
index 0000000000..f82168587e
--- /dev/null
+++ b/helpdesk_ticket_partner_response/tests/test_partner_response.py
@@ -0,0 +1,78 @@
+# Copyright 2024 Antoni Marroig(APSL-Nagarro)
+# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
+
+import json
+
+from odoo import http
+
+from odoo.addons.base.tests.common import HttpCaseWithUserPortal
+
+
+class TestCustomerResponse(HttpCaseWithUserPortal):
+ @classmethod
+ def setUpClass(cls):
+ super().setUpClass()
+ cls.helpdesk_team1 = cls.env.ref("helpdesk_mgmt.helpdesk_team_1")
+ cls.stage_new = cls.env.ref("helpdesk_mgmt.helpdesk_ticket_stage_new")
+ cls.stage_in_progress = cls.env.ref(
+ "helpdesk_mgmt.helpdesk_ticket_stage_in_progress"
+ )
+ cls.stage_done = cls.env.ref("helpdesk_mgmt.helpdesk_ticket_stage_done")
+ cls.helpdesk_team1.update(
+ {
+ "autoupdate_ticket_stage": True,
+ "autopupdate_src_stage_ids": [(4, cls.stage_in_progress.id)],
+ "autopupdate_dest_stage_id": cls.stage_done.id,
+ }
+ )
+
+ def _create_ticket(self, team, partner):
+ ticket = self.env["helpdesk.ticket"].create(
+ {
+ "name": "Ticket (%s)" % (team.name),
+ "description": "Description",
+ "team_id": team.id,
+ "partner_id": partner.id,
+ "priority": "1",
+ }
+ )
+ return ticket
+
+ def _create_message_new(self, ticket):
+ return self.url_open(
+ url="/mail/chatter_post",
+ data=json.dumps(
+ {
+ "params": {
+ "res_model": "helpdesk.ticket",
+ "res_id": ticket.id,
+ "message": "Test message",
+ "csrf_token": http.Request.csrf_token(self),
+ },
+ }
+ ),
+ headers={"Content-Type": "application/json"},
+ )
+
+ def test_change_stage_customer_answered(self):
+ self.authenticate("portal", "portal")
+ self.ticket_id = self._create_ticket(self.helpdesk_team1, self.partner_portal)
+ self.ticket_id.stage_id = self.stage_in_progress
+ res = self._create_message_new(self.ticket_id)
+ self.assertEqual(res.status_code, 200)
+ self.assertEqual(self.ticket_id.stage_id, self.stage_done)
+
+ def test_no_change_stage_customer_answered(self):
+ self.authenticate("portal", "portal")
+ self.ticket_id = self._create_ticket(self.helpdesk_team1, self.partner_portal)
+ res = self._create_message_new(self.ticket_id)
+ self.assertEqual(res.status_code, 200)
+ self.assertEqual(self.ticket_id.stage_id, self.stage_new)
+
+ def test_change_stage_deactivated(self):
+ self.authenticate("portal", "portal")
+ self.helpdesk_team1.autoupdate_ticket_stage = False
+ self.ticket_id = self._create_ticket(self.helpdesk_team1, self.partner_portal)
+ res = self._create_message_new(self.ticket_id)
+ self.assertEqual(res.status_code, 200)
+ self.assertEqual(self.ticket_id.stage_id, self.stage_new)
diff --git a/helpdesk_ticket_partner_response/views/helpdesk_ticket_team.xml b/helpdesk_ticket_partner_response/views/helpdesk_ticket_team.xml
new file mode 100644
index 0000000000..b3862f1e46
--- /dev/null
+++ b/helpdesk_ticket_partner_response/views/helpdesk_ticket_team.xml
@@ -0,0 +1,34 @@
+
+
+
+ helpdesk.ticket.team.form.inherit
+ helpdesk.ticket.team
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From d96e92043fd3222c5448f30a17482f70e2972263 Mon Sep 17 00:00:00 2001
From: mymage
Date: Thu, 2 Jan 2025 16:28:35 +0000
Subject: [PATCH 02/20] Added translation using Weblate (Italian)
---
helpdesk_ticket_partner_response/i18n/it.po | 53 +++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 helpdesk_ticket_partner_response/i18n/it.po
diff --git a/helpdesk_ticket_partner_response/i18n/it.po b/helpdesk_ticket_partner_response/i18n/it.po
new file mode 100644
index 0000000000..c046d34edb
--- /dev/null
+++ b/helpdesk_ticket_partner_response/i18n/it.po
@@ -0,0 +1,53 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * helpdesk_ticket_partner_response
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 16.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: Automatically generated\n"
+"Language-Team: none\n"
+"Language: it\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: nplurals=2; plural=n != 1;\n"
+
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage
+#: model_terms:ir.ui.view,arch_db:helpdesk_ticket_partner_response.view_helpdesk_team_form_inherit
+msgid "Auto Update Ticket Stage"
+msgstr ""
+
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_dest_stage_id
+msgid "Autoupdate Destination Stage"
+msgstr ""
+
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_src_stage_ids
+msgid "Autoupdate Source Stages"
+msgstr ""
+
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team
+msgid "Helpdesk Ticket Team"
+msgstr ""
+
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_src_stage_ids
+msgid ""
+"If a partner posts a message in a ticket on this stages, the own stage of "
+"the ticket will be update by the one set on Autoupdate Destination Stage "
+msgstr ""
+
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_dest_stage_id
+msgid "Target stage on partner's message post "
+msgstr ""
+
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage
+msgid "Update ticket stage when a new message is registered by the partner."
+msgstr ""
From 5a983007d8e712fa46d427aeddf9f14f5931bf61 Mon Sep 17 00:00:00 2001
From: mymage
Date: Sat, 4 Jan 2025 13:23:32 +0000
Subject: [PATCH 03/20] Translated using Weblate (Italian)
Currently translated at 100.0% (7 of 7 strings)
Translation: helpdesk-16.0/helpdesk-16.0-helpdesk_ticket_partner_response
Translate-URL: https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_ticket_partner_response/it/
---
helpdesk_ticket_partner_response/i18n/it.po | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/helpdesk_ticket_partner_response/i18n/it.po b/helpdesk_ticket_partner_response/i18n/it.po
index c046d34edb..040b7915b2 100644
--- a/helpdesk_ticket_partner_response/i18n/it.po
+++ b/helpdesk_ticket_partner_response/i18n/it.po
@@ -6,34 +6,36 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: Automatically generated\n"
+"PO-Revision-Date: 2025-01-04 16:06+0000\n"
+"Last-Translator: mymage \n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
+"X-Generator: Weblate 5.6.2\n"
#. module: helpdesk_ticket_partner_response
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage
#: model_terms:ir.ui.view,arch_db:helpdesk_ticket_partner_response.view_helpdesk_team_form_inherit
msgid "Auto Update Ticket Stage"
-msgstr ""
+msgstr "Aggiorna automaticamente fase ticket"
#. module: helpdesk_ticket_partner_response
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_dest_stage_id
msgid "Autoupdate Destination Stage"
-msgstr ""
+msgstr "Aggiorna automaticamente fase destinazione"
#. module: helpdesk_ticket_partner_response
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_src_stage_ids
msgid "Autoupdate Source Stages"
-msgstr ""
+msgstr "Aggiorna automaticamente fase origine"
#. module: helpdesk_ticket_partner_response
#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team
msgid "Helpdesk Ticket Team"
-msgstr ""
+msgstr "Team ticket assistenza clienti"
#. module: helpdesk_ticket_partner_response
#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_src_stage_ids
@@ -41,13 +43,18 @@ msgid ""
"If a partner posts a message in a ticket on this stages, the own stage of "
"the ticket will be update by the one set on Autoupdate Destination Stage "
msgstr ""
+"Se un partner invia un messaggio in un ticket in questa fase, la stessa fase "
+"del ticket verrà aggiornata a quella impostata in Aggiornamento automatico "
+"fase destinazione "
#. module: helpdesk_ticket_partner_response
#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_dest_stage_id
msgid "Target stage on partner's message post "
-msgstr ""
+msgstr "Fase obiettivo nell'invio messaggio del partner "
#. module: helpdesk_ticket_partner_response
#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage
msgid "Update ticket stage when a new message is registered by the partner."
msgstr ""
+"Aggiorna la fase del ticket quando un nuovo messaggio viene registrato dal "
+"partner."
From 0b7cdcee766dc5fc10cc79920dde32c1411d2203 Mon Sep 17 00:00:00 2001
From: Antoni Marroig Campomar
Date: Thu, 9 Jan 2025 13:50:05 +0100
Subject: [PATCH 04/20] [16.0][FIX] helpdesk_ticket_partner_response: Fix mail
thread change stage
---
helpdesk_ticket_partner_response/README.rst | 2 +-
.../__manifest__.py | 2 +-
helpdesk_ticket_partner_response/i18n/ca.po | 5 +
helpdesk_ticket_partner_response/i18n/es.po | 5 +
.../i18n/helpdesk_ticket_partner_response.pot | 5 +
helpdesk_ticket_partner_response/i18n/it.po | 5 +
.../models/__init__.py | 1 +
.../models/mail_thread.py | 27 +
.../static/description/index.html | 568 ++++++++++++++----
9 files changed, 494 insertions(+), 126 deletions(-)
create mode 100644 helpdesk_ticket_partner_response/models/mail_thread.py
diff --git a/helpdesk_ticket_partner_response/README.rst b/helpdesk_ticket_partner_response/README.rst
index 4dfe313aa1..88363e4bfb 100644
--- a/helpdesk_ticket_partner_response/README.rst
+++ b/helpdesk_ticket_partner_response/README.rst
@@ -7,7 +7,7 @@ Helpdesk Ticket Partner Response
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- !! source digest: sha256:ba0afeaf6a51755decd7ebf7af7aaa74ea7961d668a33ea358408f3452caa97b
+ !! source digest: sha256:41ec07506f9e5e571fc48a6559155e4f2b4a8dfa0a9be0bf8b4afef9dd4efab9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
diff --git a/helpdesk_ticket_partner_response/__manifest__.py b/helpdesk_ticket_partner_response/__manifest__.py
index 45799cf017..a70ccce193 100644
--- a/helpdesk_ticket_partner_response/__manifest__.py
+++ b/helpdesk_ticket_partner_response/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "Helpdesk Ticket Partner Response",
"summary": "Change ticket stage when partner response",
- "version": "16.0.1.0.0",
+ "version": "16.0.1.1.0",
"category": "Helpdesk",
"website": "https://github.com/OCA/helpdesk",
"author": "Antoni Marroig, APSL-Nagarro, Odoo Community Association (OCA)",
diff --git a/helpdesk_ticket_partner_response/i18n/ca.po b/helpdesk_ticket_partner_response/i18n/ca.po
index 13a95064bc..8072f2fc1d 100644
--- a/helpdesk_ticket_partner_response/i18n/ca.po
+++ b/helpdesk_ticket_partner_response/i18n/ca.po
@@ -32,6 +32,11 @@ msgstr "Etapa de destinació d'actualització automàtica"
msgid "Autoupdate Source Stages"
msgstr "Etapes d'origen d'actualització automàtica"
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model,name:helpdesk_ticket_partner_response.model_mail_thread
+msgid "Email Thread"
+msgstr ""
+
#. module: helpdesk_ticket_partner_response
#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team
msgid "Helpdesk Ticket Team"
diff --git a/helpdesk_ticket_partner_response/i18n/es.po b/helpdesk_ticket_partner_response/i18n/es.po
index e84bd5590a..19b1b6cfb7 100644
--- a/helpdesk_ticket_partner_response/i18n/es.po
+++ b/helpdesk_ticket_partner_response/i18n/es.po
@@ -32,6 +32,11 @@ msgstr "Etapa de destino de actualización automática"
msgid "Autoupdate Source Stages"
msgstr "Etapas de origen de actualización automática"
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model,name:helpdesk_ticket_partner_response.model_mail_thread
+msgid "Email Thread"
+msgstr ""
+
#. module: helpdesk_ticket_partner_response
#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team
msgid "Helpdesk Ticket Team"
diff --git a/helpdesk_ticket_partner_response/i18n/helpdesk_ticket_partner_response.pot b/helpdesk_ticket_partner_response/i18n/helpdesk_ticket_partner_response.pot
index 8b12e40048..23d59848c8 100644
--- a/helpdesk_ticket_partner_response/i18n/helpdesk_ticket_partner_response.pot
+++ b/helpdesk_ticket_partner_response/i18n/helpdesk_ticket_partner_response.pot
@@ -29,6 +29,11 @@ msgstr ""
msgid "Autoupdate Source Stages"
msgstr ""
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model,name:helpdesk_ticket_partner_response.model_mail_thread
+msgid "Email Thread"
+msgstr ""
+
#. module: helpdesk_ticket_partner_response
#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team
msgid "Helpdesk Ticket Team"
diff --git a/helpdesk_ticket_partner_response/i18n/it.po b/helpdesk_ticket_partner_response/i18n/it.po
index 040b7915b2..6dae86cbc6 100644
--- a/helpdesk_ticket_partner_response/i18n/it.po
+++ b/helpdesk_ticket_partner_response/i18n/it.po
@@ -32,6 +32,11 @@ msgstr "Aggiorna automaticamente fase destinazione"
msgid "Autoupdate Source Stages"
msgstr "Aggiorna automaticamente fase origine"
+#. module: helpdesk_ticket_partner_response
+#: model:ir.model,name:helpdesk_ticket_partner_response.model_mail_thread
+msgid "Email Thread"
+msgstr ""
+
#. module: helpdesk_ticket_partner_response
#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team
msgid "Helpdesk Ticket Team"
diff --git a/helpdesk_ticket_partner_response/models/__init__.py b/helpdesk_ticket_partner_response/models/__init__.py
index a68d1884da..4ee2a1e429 100644
--- a/helpdesk_ticket_partner_response/models/__init__.py
+++ b/helpdesk_ticket_partner_response/models/__init__.py
@@ -1,3 +1,4 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import helpdesk_ticket_team
+from . import mail_thread
diff --git a/helpdesk_ticket_partner_response/models/mail_thread.py b/helpdesk_ticket_partner_response/models/mail_thread.py
new file mode 100644
index 0000000000..41354c85f0
--- /dev/null
+++ b/helpdesk_ticket_partner_response/models/mail_thread.py
@@ -0,0 +1,27 @@
+from odoo import api, models
+
+
+class MailThread(models.AbstractModel):
+ _inherit = "mail.thread"
+
+ @api.model
+ def _message_route_process(self, message, message_dict, routes):
+ self.change_status_ticket_from_portal(routes)
+ return super()._message_route_process(message, message_dict, routes)
+
+ def change_status_ticket_from_portal(self, routes):
+ if routes and routes[0][0] == "helpdesk.ticket":
+ ticket_id = routes[0][1]
+ ticket = self.env["helpdesk.ticket"].sudo().browse(int(ticket_id))
+ partner_id = (
+ self.env["res.users"]
+ .search([("id", "=", routes[0][3])], limit=1)
+ .partner_id.id
+ )
+ if (
+ ticket
+ and partner_id == ticket.partner_id.id
+ and ticket.team_id.autoupdate_ticket_stage
+ and ticket.stage_id in ticket.team_id.autopupdate_src_stage_ids
+ ):
+ ticket.stage_id = ticket.team_id.autopupdate_dest_stage_id.id
diff --git a/helpdesk_ticket_partner_response/static/description/index.html b/helpdesk_ticket_partner_response/static/description/index.html
index f92d18ab8d..1a55e03562 100644
--- a/helpdesk_ticket_partner_response/static/description/index.html
+++ b/helpdesk_ticket_partner_response/static/description/index.html
@@ -1,124 +1,444 @@
-
-
-
-
Module name
-
This module was written to extend the functionality of ... to support ... and allow you to ...
- This module is maintained by the OCA.
- OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.
- To contribute to this module, please visit http://odoo-community.org.
-
-
Set ticket source and destination stages from where if a message by the
+partner is posted autopdation have to be triggered. To setup this
+configuration you have to go to Helpdesk > Settings > Teams > Autoupdate
+ticket stage
This module adds the option from helpdesk team to automate the ticket
+stage update when a partner posts a message on the same ticket. This is
+useful when exists an specific stage for the tickets that his last
+update is answer by the partner.
Bugs are tracked on GitHub Issues.
+In case of trouble, please check there if your issue has already been reported.
+If you spotted it first, help us to smash it by providing a detailed and welcomed
+feedback.
+
Do not contact contributors directly about support or help with technical issues.
OCA, or the Odoo Community Association, is a nonprofit organization whose
+mission is to support the collaborative development of Odoo features and
+promote its widespread use.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.
Set ticket source and destination stages from where if a message by the
partner is posted autopdation have to be triggered. To setup this
configuration you have to go to Helpdesk > Settings > Teams > Autoupdate
ticket stage
This module adds the option from helpdesk team to automate the ticket
stage update when a partner posts a message on the same ticket. This is
useful when exists an specific stage for the tickets that his last
update is answer by the partner.
Bugs are tracked on GitHub Issues.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
-feedback.