-
-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[16.0][ADD] helpdesk_ticket_customer_response: New module helpdesk_ti…
…cket_customer_response
- Loading branch information
Showing
21 changed files
with
708 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
================================ | ||
Helpdesk Ticket Partner Response | ||
================================ | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:c6d83a14ee5d9e8f7b5ac9c65cc3bf6482df385c0d1f9e996befd495eb071938 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhelpdesk-lightgray.png?logo=github | ||
:target: https://github.com/OCA/helpdesk/tree/16.0/helpdesk_ticket_partner_response | ||
:alt: OCA/helpdesk | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_ticket_partner_response | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&target_branch=16.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
Autoupdate ticket stage when a partner posts a message on the ticket | ||
from the portal or by sending an email. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Configuration | ||
============= | ||
|
||
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 | ||
|
||
Usage | ||
===== | ||
|
||
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. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/helpdesk/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 <https://github.com/OCA/helpdesk/issues/new?body=module:%20helpdesk_ticket_partner_response%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* Antoni Marroig | ||
* APSL-Nagarro | ||
|
||
Contributors | ||
------------ | ||
|
||
[APSL-Nagarro](https://apsl.tech): | ||
|
||
- Antoni Marroig <amarroig@apsl.net> | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
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. | ||
|
||
.. |maintainer-peluko00| image:: https://github.com/peluko00.png?size=40px | ||
:target: https://github.com/peluko00 | ||
:alt: peluko00 | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-peluko00| | ||
|
||
This module is part of the `OCA/helpdesk <https://github.com/OCA/helpdesk/tree/16.0/helpdesk_ticket_partner_response>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import models | ||
from . import controllers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2024 Antoni Marroig(APSL-Nagarro)<amarroig@apsl.net> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
{ | ||
"name": "Helpdesk Ticket Partner Response", | ||
"summary": "Change ticket stage when partner response", | ||
"version": "16.0.1.0.0", | ||
"category": "Helpdesk", | ||
"website": "https://github.com/OCA/helpdesk", | ||
"author": "Antoni Marroig, APSL-Nagarro, Odoo Community Association (OCA)", | ||
"maintainers": ["peluko00"], | ||
"license": "AGPL-3", | ||
"application": False, | ||
"installable": True, | ||
"depends": ["helpdesk_mgmt"], | ||
"data": [ | ||
"views/helpdesk_ticket_team.xml", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import mail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
# Copyright 2024 Antoni Marroig(APSL-Nagarro)<amarroig@apsl.net> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
import odoo.http as http | ||
from odoo.http import request | ||
from odoo.tools import plaintext2html | ||
|
||
from odoo.addons.portal.controllers.mail import PortalChatter, _message_post_helper | ||
|
||
|
||
class HelpdeskCustomerResponse(PortalChatter): | ||
def change_status_ticket_from_portal(self, post_values): | ||
if post_values["res_model"] == "helpdesk.ticket": | ||
ticket_id = post_values["res_id"] | ||
ticket = request.env["helpdesk.ticket"].sudo().browse(int(ticket_id)) | ||
if ( | ||
ticket | ||
and request.env.user.partner_id.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 | ||
|
||
@http.route( | ||
["/mail/chatter_post"], | ||
type="json", | ||
methods=["POST"], | ||
auth="public", | ||
website=True, | ||
) | ||
def portal_chatter_post( | ||
self, | ||
res_model, | ||
res_id, | ||
message, | ||
attachment_ids=None, | ||
attachment_tokens=None, | ||
**kw | ||
): | ||
if not self._portal_post_has_content( | ||
res_model, | ||
res_id, | ||
message, | ||
attachment_ids=attachment_ids, | ||
attachment_tokens=attachment_tokens, | ||
**kw | ||
): | ||
return | ||
|
||
res_id = int(res_id) | ||
|
||
self._portal_post_check_attachments( | ||
attachment_ids or [], attachment_tokens or [] | ||
) | ||
|
||
result = {"default_message": message} | ||
# message is received in plaintext and saved in html | ||
if message: | ||
message = plaintext2html(message) | ||
post_values = { | ||
"res_model": res_model, | ||
"res_id": res_id, | ||
"message": message, | ||
"send_after_commit": False, | ||
"attachment_ids": False, # will be added afterward | ||
} | ||
post_values.update( | ||
(fname, kw.get(fname)) for fname in self._portal_post_filter_params() | ||
) | ||
post_values["_hash"] = kw.get("hash") | ||
message = _message_post_helper(**post_values) | ||
result.update({"default_message_id": message.id}) | ||
|
||
if attachment_ids: | ||
# sudo write the attachment to bypass the read access | ||
# verification in mail message | ||
record = request.env[res_model].browse(res_id) | ||
message_values = {"res_id": res_id, "model": res_model} | ||
attachments = record._message_post_process_attachments( | ||
[], attachment_ids, message_values | ||
) | ||
|
||
if attachments.get("attachment_ids"): | ||
message.sudo().write(attachments) | ||
|
||
result.update( | ||
{ | ||
"default_attachment_ids": message.attachment_ids.sudo().read( | ||
["id", "name", "mimetype", "file_size", "access_token"] | ||
) | ||
} | ||
) | ||
|
||
self.change_status_ticket_from_portal(post_values) | ||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# 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" | ||
"POT-Creation-Date: 2025-01-02 08:04+0000\n" | ||
"PO-Revision-Date: 2025-01-02 08:04+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: helpdesk_ticket_partner_response | ||
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage | ||
msgid "Auto Update Ticket Stage" | ||
msgstr "Etapa d'actualització automàtica de tiquets" | ||
|
||
#. module: helpdesk_ticket_partner_response | ||
#: model_terms:ir.ui.view,arch_db:helpdesk_ticket_partner_response.view_helpdesk_team_form_inherit | ||
msgid "Automatic change stage when partner answered" | ||
msgstr "Etapa de canvi automàtic quan el soci respon" | ||
|
||
#. 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 "Etapa de destinació d'actualització automàtica" | ||
|
||
#. 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 "Etapes d'origen d'actualització automàtica" | ||
|
||
#. module: helpdesk_ticket_partner_response | ||
#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team | ||
msgid "Helpdesk Ticket Team" | ||
msgstr "Equip del tiquet del centre d'assistència" | ||
|
||
#. 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 "" | ||
"Si un soci publica un missatge en un ticket en aquestes etapes, la pròpia " | ||
"etapa de el ticket s'actualitzarà pel que s'estableix a l'etapa de " | ||
"destinació d'actualització automàtica" | ||
|
||
#. 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 "Etapa objectiu a la publicació de missatges del soci" | ||
|
||
#. 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 "Actualitzar l'etapa del ticket quan el soci registra un missatge nou." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# 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" | ||
"POT-Creation-Date: 2025-01-02 08:05+0000\n" | ||
"PO-Revision-Date: 2025-01-02 08:05+0000\n" | ||
"Last-Translator: \n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: helpdesk_ticket_partner_response | ||
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage | ||
msgid "Auto Update Ticket Stage" | ||
msgstr "Etapa de actualización automática de tickets" | ||
|
||
#. module: helpdesk_ticket_partner_response | ||
#: model_terms:ir.ui.view,arch_db:helpdesk_ticket_partner_response.view_helpdesk_team_form_inherit | ||
msgid "Automatic change stage when partner answered" | ||
msgstr "Etapa de cambio automático cuando el socio responde" | ||
|
||
#. 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 "Etapa de destino de actualización automática" | ||
|
||
#. 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 "Etapas de origen de actualización automática" | ||
|
||
#. module: helpdesk_ticket_partner_response | ||
#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team | ||
msgid "Helpdesk Ticket Team" | ||
msgstr "Equipo de ticket Helpdesk" | ||
|
||
#. 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 "" | ||
"Si un socio publica un mensaje en un ticket en esta etapa, la propia etapa de " | ||
"el ticket se actualizará según el establecido en la etapa de destino de actualización automática" | ||
|
||
#. 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 "Etapa objetivo en la publicación del mensaje del socio" | ||
|
||
#. 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 "Etapa de actualización del ticket cuando el socio registra un nuevo mensaje." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import helpdesk_ticket_team |
29 changes: 29 additions & 0 deletions
29
helpdesk_ticket_partner_response/models/helpdesk_ticket_team.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Copyright 2024 Antoni Marroig(APSL-Nagarro)<amarroig@apsl.net> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class HelpdeskTicketTeam(models.Model): | ||
_inherit = "helpdesk.ticket.team" | ||
|
||
autoupdate_ticket_stage = fields.Boolean( | ||
string="Auto Update Ticket Stage", | ||
help="Update ticket stage when a new message is registered by the partner.", | ||
default=False, | ||
) | ||
autopupdate_src_stage_ids = fields.Many2many( | ||
comodel_name="helpdesk.ticket.stage", | ||
relation="change_stage_partner_response", | ||
string="Autoupdate Source Stages", | ||
help=( | ||
"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 " | ||
), | ||
) | ||
autopupdate_dest_stage_id = fields.Many2one( | ||
"helpdesk.ticket.stage", | ||
string="Autoupdate Destination Stage", | ||
help=("Target stage on partner's message post "), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
\[APSL-Nagarro\](<https://apsl.tech>): | ||
- Antoni Marroig \<<amarroig@apsl.net>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Autoupdate ticket stage when a partner posts a message on the ticket from the portal or by sending an email. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.