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

[15.0][FIX] helpdesk_mgmt: Fixes to automatic email sending according to stage #508

Merged
merged 1 commit into from
Oct 2, 2023
Merged
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
5 changes: 5 additions & 0 deletions helpdesk_mgmt/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ def _prepare_submit_ticket_vals(self, **kw):
"partner_id": request.env.user.partner_id.id,
"partner_name": request.env.user.partner_id.name,
"partner_email": request.env.user.partner_id.email,
# Need to set stage_id so that the _track_template() method is called
# and the mail is sent automatically if applicable
"stage_id": request.env["helpdesk.ticket"].default_get(["stage_id"])[
"stage_id"
],
}
if company.helpdesk_mgmt_portal_select_team:
team = (
Expand Down
2 changes: 2 additions & 0 deletions helpdesk_mgmt/models/helpdesk_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ def _track_template(self, tracking):
res["stage_id"] = (
ticket.stage_id.mail_template_id,
{
# Need to set mass_mail so that the email will always be sent
"composition_mode": "mass_mail",
victoralmau marked this conversation as resolved.
Show resolved Hide resolved
"auto_delete_message": True,
"subtype_id": self.env["ir.model.data"]._xmlid_to_res_id(
"mail.mt_note"
Expand Down
Loading