Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] helpdesk_ticket_partner_response: Fix mail thread change stage #679

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions helpdesk_ticket_partner_response/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:c5907d9a9d20c4cce131b0414eeb303d5710df2707cf758380e06b8cc71a4e17
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down Expand Up @@ -76,7 +76,7 @@ Contributors

[APSL-Nagarro](https://apsl.tech):

- Antoni Marroig <[email protected]>
- Antoni Marroig <[email protected]>

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion helpdesk_ticket_partner_response/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.0.1",
"category": "Helpdesk",
"website": "https://github.com/OCA/helpdesk",
"author": "Antoni Marroig, APSL-Nagarro, Odoo Community Association (OCA)",
Expand Down
1 change: 1 addition & 0 deletions helpdesk_ticket_partner_response/models/__init__.py
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions helpdesk_ticket_partner_response/models/mail_thread.py
Original file line number Diff line number Diff line change
@@ -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)

Check warning on line 10 in helpdesk_ticket_partner_response/models/mail_thread.py

View check run for this annotation

Codecov / codecov/patch

helpdesk_ticket_partner_response/models/mail_thread.py#L9-L10

Added lines #L9 - L10 were not covered by tests

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 = (

Check warning on line 16 in helpdesk_ticket_partner_response/models/mail_thread.py

View check run for this annotation

Codecov / codecov/patch

helpdesk_ticket_partner_response/models/mail_thread.py#L14-L16

Added lines #L14 - L16 were not covered by tests
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

Check warning on line 27 in helpdesk_ticket_partner_response/models/mail_thread.py

View check run for this annotation

Codecov / codecov/patch

helpdesk_ticket_partner_response/models/mail_thread.py#L27

Added line #L27 was not covered by tests
Loading
Loading