Skip to content

Commit f23fd64

Browse files
committed
Merge branch '16.0' of github.com:onesteinbv/addons-oca into 16.0
2 parents 9b9e897 + 723779c commit f23fd64

39 files changed

+1967
-6
lines changed
+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
================================
2+
Helpdesk Ticket Partner Response
3+
================================
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:41ec07506f9e5e571fc48a6559155e4f2b4a8dfa0a9be0bf8b4afef9dd4efab9
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhelpdesk-lightgray.png?logo=github
20+
:target: https://github.com/OCA/helpdesk/tree/16.0/helpdesk_ticket_partner_response
21+
:alt: OCA/helpdesk
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/helpdesk-16-0/helpdesk-16-0-helpdesk_ticket_partner_response
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/helpdesk&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Autoupdate ticket stage when a partner posts a message on the ticket
32+
from the portal or by sending an email.
33+
34+
**Table of contents**
35+
36+
.. contents::
37+
:local:
38+
39+
Configuration
40+
=============
41+
42+
Set ticket source and destination stages from where if a message by the
43+
partner is posted autopdation have to be triggered. To setup this
44+
configuration you have to go to Helpdesk > Settings > Teams > Autoupdate
45+
ticket stage
46+
47+
Usage
48+
=====
49+
50+
This module adds the option from helpdesk team to automate the ticket
51+
stage update when a partner posts a message on the same ticket. This is
52+
useful when exists an specific stage for the tickets that his last
53+
update is answer by the partner.
54+
55+
Bug Tracker
56+
===========
57+
58+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/helpdesk/issues>`_.
59+
In case of trouble, please check there if your issue has already been reported.
60+
If you spotted it first, help us to smash it by providing a detailed and welcomed
61+
`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**>`_.
62+
63+
Do not contact contributors directly about support or help with technical issues.
64+
65+
Credits
66+
=======
67+
68+
Authors
69+
-------
70+
71+
* Antoni Marroig
72+
* APSL-Nagarro
73+
74+
Contributors
75+
------------
76+
77+
[APSL-Nagarro](https://apsl.tech):
78+
79+
- Antoni Marroig <amarroig@apsl.net>
80+
81+
Maintainers
82+
-----------
83+
84+
This module is maintained by the OCA.
85+
86+
.. image:: https://odoo-community.org/logo.png
87+
:alt: Odoo Community Association
88+
:target: https://odoo-community.org
89+
90+
OCA, or the Odoo Community Association, is a nonprofit organization whose
91+
mission is to support the collaborative development of Odoo features and
92+
promote its widespread use.
93+
94+
.. |maintainer-peluko00| image:: https://github.com/peluko00.png?size=40px
95+
:target: https://github.com/peluko00
96+
:alt: peluko00
97+
98+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
99+
100+
|maintainer-peluko00|
101+
102+
This module is part of the `OCA/helpdesk <https://github.com/OCA/helpdesk/tree/16.0/helpdesk_ticket_partner_response>`_ project on GitHub.
103+
104+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import models
4+
from . import controllers
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright 2024 Antoni Marroig(APSL-Nagarro)<amarroig@apsl.net>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
{
4+
"name": "Helpdesk Ticket Partner Response",
5+
"summary": "Change ticket stage when partner response",
6+
"version": "16.0.1.1.0",
7+
"category": "Helpdesk",
8+
"website": "https://github.com/OCA/helpdesk",
9+
"author": "Antoni Marroig, APSL-Nagarro, Odoo Community Association (OCA)",
10+
"maintainers": ["peluko00"],
11+
"license": "AGPL-3",
12+
"application": False,
13+
"installable": True,
14+
"depends": ["helpdesk_mgmt"],
15+
"data": [
16+
"views/helpdesk_ticket_team.xml",
17+
],
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import mail
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Copyright 2024 Antoni Marroig(APSL-Nagarro)<amarroig@apsl.net>
2+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
3+
4+
import odoo.http as http
5+
from odoo.http import request
6+
from odoo.tools import plaintext2html
7+
8+
from odoo.addons.portal.controllers.mail import PortalChatter, _message_post_helper
9+
10+
11+
class HelpdeskCustomerResponse(PortalChatter):
12+
def change_status_ticket_from_portal(self, post_values):
13+
if post_values["res_model"] == "helpdesk.ticket":
14+
ticket_id = post_values["res_id"]
15+
ticket = request.env["helpdesk.ticket"].sudo().browse(int(ticket_id))
16+
if (
17+
ticket
18+
and request.env.user.partner_id.id == ticket.partner_id.id
19+
and ticket.team_id.autoupdate_ticket_stage
20+
and ticket.stage_id in ticket.team_id.autopupdate_src_stage_ids
21+
):
22+
ticket.stage_id = ticket.team_id.autopupdate_dest_stage_id.id
23+
24+
@http.route(
25+
["/mail/chatter_post"],
26+
type="json",
27+
methods=["POST"],
28+
auth="public",
29+
website=True,
30+
)
31+
def portal_chatter_post(
32+
self,
33+
res_model,
34+
res_id,
35+
message,
36+
attachment_ids=None,
37+
attachment_tokens=None,
38+
**kw
39+
):
40+
if not self._portal_post_has_content(
41+
res_model,
42+
res_id,
43+
message,
44+
attachment_ids=attachment_ids,
45+
attachment_tokens=attachment_tokens,
46+
**kw
47+
):
48+
return
49+
50+
res_id = int(res_id)
51+
52+
self._portal_post_check_attachments(
53+
attachment_ids or [], attachment_tokens or []
54+
)
55+
56+
result = {"default_message": message}
57+
# message is received in plaintext and saved in html
58+
if message:
59+
message = plaintext2html(message)
60+
post_values = {
61+
"res_model": res_model,
62+
"res_id": res_id,
63+
"message": message,
64+
"send_after_commit": False,
65+
"attachment_ids": False, # will be added afterward
66+
}
67+
post_values.update(
68+
(fname, kw.get(fname)) for fname in self._portal_post_filter_params()
69+
)
70+
post_values["_hash"] = kw.get("hash")
71+
message = _message_post_helper(**post_values)
72+
result.update({"default_message_id": message.id})
73+
74+
if attachment_ids:
75+
# sudo write the attachment to bypass the read access
76+
# verification in mail message
77+
record = request.env[res_model].browse(res_id)
78+
message_values = {"res_id": res_id, "model": res_model}
79+
attachments = record._message_post_process_attachments(
80+
[], attachment_ids, message_values
81+
)
82+
83+
if attachments.get("attachment_ids"):
84+
message.sudo().write(attachments)
85+
86+
result.update(
87+
{
88+
"default_attachment_ids": message.attachment_ids.sudo().read(
89+
["id", "name", "mimetype", "file_size", "access_token"]
90+
)
91+
}
92+
)
93+
94+
self.change_status_ticket_from_portal(post_values)
95+
return result
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * helpdesk_ticket_partner_response
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-01-02 09:19+0000\n"
10+
"PO-Revision-Date: 2025-01-02 09:19+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: \n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: \n"
17+
"Plural-Forms: \n"
18+
19+
#. module: helpdesk_ticket_partner_response
20+
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage
21+
#: model_terms:ir.ui.view,arch_db:helpdesk_ticket_partner_response.view_helpdesk_team_form_inherit
22+
msgid "Auto Update Ticket Stage"
23+
msgstr "Etapa d'actualització automàtica de tiquets"
24+
25+
#. module: helpdesk_ticket_partner_response
26+
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_dest_stage_id
27+
msgid "Autoupdate Destination Stage"
28+
msgstr "Etapa de destinació d'actualització automàtica"
29+
30+
#. module: helpdesk_ticket_partner_response
31+
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_src_stage_ids
32+
msgid "Autoupdate Source Stages"
33+
msgstr "Etapes d'origen d'actualització automàtica"
34+
35+
#. module: helpdesk_ticket_partner_response
36+
#: model:ir.model,name:helpdesk_ticket_partner_response.model_mail_thread
37+
msgid "Email Thread"
38+
msgstr ""
39+
40+
#. module: helpdesk_ticket_partner_response
41+
#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team
42+
msgid "Helpdesk Ticket Team"
43+
msgstr "Equip del tiquet del centre d'assistència"
44+
45+
#. module: helpdesk_ticket_partner_response
46+
#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_src_stage_ids
47+
msgid ""
48+
"If a partner posts a message in a ticket on this stages, the own stage of "
49+
"the ticket will be update by the one set on Autoupdate Destination Stage "
50+
msgstr ""
51+
"Si un soci publica un missatge en un ticket en aquestes etapes, la pròpia "
52+
"etapa de el ticket s'actualitzarà pel que s'estableix a l'etapa de "
53+
"destinació d'actualització automàtica"
54+
55+
#. module: helpdesk_ticket_partner_response
56+
#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_dest_stage_id
57+
msgid "Target stage on partner's message post "
58+
msgstr "Etapa objectiu a la publicació de missatges del soci"
59+
60+
#. module: helpdesk_ticket_partner_response
61+
#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage
62+
msgid "Update ticket stage when a new message is registered by the partner."
63+
msgstr "Actualitzar l'etapa del ticket quan el soci registra un missatge nou."
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Translation of Odoo Server.
2+
# This file contains the translation of the following modules:
3+
# * helpdesk_ticket_partner_response
4+
#
5+
msgid ""
6+
msgstr ""
7+
"Project-Id-Version: Odoo Server 16.0\n"
8+
"Report-Msgid-Bugs-To: \n"
9+
"POT-Creation-Date: 2025-01-02 09:19+0000\n"
10+
"PO-Revision-Date: 2025-01-02 09:19+0000\n"
11+
"Last-Translator: \n"
12+
"Language-Team: \n"
13+
"Language: \n"
14+
"MIME-Version: 1.0\n"
15+
"Content-Type: text/plain; charset=UTF-8\n"
16+
"Content-Transfer-Encoding: \n"
17+
"Plural-Forms: \n"
18+
19+
#. module: helpdesk_ticket_partner_response
20+
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage
21+
#: model_terms:ir.ui.view,arch_db:helpdesk_ticket_partner_response.view_helpdesk_team_form_inherit
22+
msgid "Auto Update Ticket Stage"
23+
msgstr "Etapa de actualización automática de tickets"
24+
25+
#. module: helpdesk_ticket_partner_response
26+
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_dest_stage_id
27+
msgid "Autoupdate Destination Stage"
28+
msgstr "Etapa de destino de actualización automática"
29+
30+
#. module: helpdesk_ticket_partner_response
31+
#: model:ir.model.fields,field_description:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_src_stage_ids
32+
msgid "Autoupdate Source Stages"
33+
msgstr "Etapas de origen de actualización automática"
34+
35+
#. module: helpdesk_ticket_partner_response
36+
#: model:ir.model,name:helpdesk_ticket_partner_response.model_mail_thread
37+
msgid "Email Thread"
38+
msgstr ""
39+
40+
#. module: helpdesk_ticket_partner_response
41+
#: model:ir.model,name:helpdesk_ticket_partner_response.model_helpdesk_ticket_team
42+
msgid "Helpdesk Ticket Team"
43+
msgstr "Equipo de ticket Helpdesk"
44+
45+
#. module: helpdesk_ticket_partner_response
46+
#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_src_stage_ids
47+
msgid ""
48+
"If a partner posts a message in a ticket on this stages, the own stage of "
49+
"the ticket will be update by the one set on Autoupdate Destination Stage "
50+
msgstr ""
51+
"Si un socio publica un mensaje en un ticket en esta etapa, la propia etapa "
52+
"de el ticket se actualizará según el establecido en la etapa de destino de "
53+
"actualización automática"
54+
55+
#. module: helpdesk_ticket_partner_response
56+
#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autopupdate_dest_stage_id
57+
msgid "Target stage on partner's message post "
58+
msgstr "Etapa objetivo en la publicación del mensaje del socio"
59+
60+
#. module: helpdesk_ticket_partner_response
61+
#: model:ir.model.fields,help:helpdesk_ticket_partner_response.field_helpdesk_ticket_team__autoupdate_ticket_stage
62+
msgid "Update ticket stage when a new message is registered by the partner."
63+
msgstr ""
64+
"Etapa de actualización del ticket cuando el socio registra un nuevo mensaje."

0 commit comments

Comments
 (0)