From 0815f7c9c0290507141b27f0d95870bb00c1650b Mon Sep 17 00:00:00 2001 From: Cybrosys Technologies Date: Mon, 19 May 2025 16:05:02 +0530 Subject: [PATCH] May 19: [FIX] Bug Fixed 'odoo_website_helpdesk' --- odoo_website_helpdesk/__manifest__.py | 2 +- odoo_website_helpdesk/controller/website_form.py | 14 +++++++++++++- odoo_website_helpdesk/doc/RELEASE_NOTES.md | 15 ++++++++++++++- .../static/description/index.html | 2 ++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/odoo_website_helpdesk/__manifest__.py b/odoo_website_helpdesk/__manifest__.py index 4fe34b9cf..d8af91749 100644 --- a/odoo_website_helpdesk/__manifest__.py +++ b/odoo_website_helpdesk/__manifest__.py @@ -21,7 +21,7 @@ ################################################################################ { 'name': "Website Helpdesk Management", - 'version': '18.0.1.0.1', + 'version': '18.0.1.0.2', 'category': 'Website', 'summary': """The website allows for the creation of tickets, which can then be controlled from the backend.""", diff --git a/odoo_website_helpdesk/controller/website_form.py b/odoo_website_helpdesk/controller/website_form.py index 45e7de875..5f303e717 100644 --- a/odoo_website_helpdesk/controller/website_form.py +++ b/odoo_website_helpdesk/controller/website_form.py @@ -103,8 +103,20 @@ class WebsiteFormInherit(WebsiteForm): 'ticket_type_id': kwargs.get('ticket_type_id'), 'category_id': kwargs.get('category'), } - ticket_id = request.env['ticket.helpdesk'].sudo().create(rec_val) + if ticket_id and partner_create.email: + request.env['mail.mail'].sudo().create({ + 'subject': 'Your Ticket Has Been Created', + 'body_html': f"

Hello {partner_create.name},

Your ticket {ticket_id.name} with the subject {ticket_id.subject} has been successfully submitted. Our support team will contact you soon.

Thank You.

", + 'email_to': partner_create.email, + 'email_from': request.env.user.email or 'support@example.com', + }).send() + ticket_id.message_post( + body="A confirmation email regarding the ticket creation has been sent to the customer.", + subject="Ticket Confirmation Email", + message_type='email', + subtype_xmlid="mail.mt_comment", + ) request.session['ticket_number'] = ticket_id.name request.session['ticket_id'] = ticket_id.id model_record = request.env['ir.model'].sudo().search( diff --git a/odoo_website_helpdesk/doc/RELEASE_NOTES.md b/odoo_website_helpdesk/doc/RELEASE_NOTES.md index 9f6bf0458..1f9bec8cb 100644 --- a/odoo_website_helpdesk/doc/RELEASE_NOTES.md +++ b/odoo_website_helpdesk/doc/RELEASE_NOTES.md @@ -9,4 +9,17 @@ #### 12.02.2025 #### Version 18.0.1.0.1 ##### UPDT --A new contact record is created upon form submission. \ No newline at end of file +-A new contact record is created upon form submission. + +#### 13.05.2025 +#### Version 18.0.1.0.2 +##### UPDT +-A confirmation email will be sent to the customer upon ticket creation. + + + + + + + + diff --git a/odoo_website_helpdesk/static/description/index.html b/odoo_website_helpdesk/static/description/index.html index d444fe44a..be4e8a1e9 100644 --- a/odoo_website_helpdesk/static/description/index.html +++ b/odoo_website_helpdesk/static/description/index.html @@ -910,6 +910,8 @@ Website Ticket Creation

Then you may see the ticket's Reference Code in the Thank You page that appears when the helpdesk ticket is generated.

+

A confirmation email will be sent to the customer upon ticket creation. +