Browse Source

May 20: [FIX] Bug Fixed 'odoo_website_helpdesk'

17.0
Cybrosys Technologies 4 days ago
parent
commit
34d4608f5c
  1. 2
      odoo_website_helpdesk/__manifest__.py
  2. 15
      odoo_website_helpdesk/controllers/website_form.py
  3. 6
      odoo_website_helpdesk/doc/RELEASE_NOTES.md
  4. 2
      odoo_website_helpdesk/static/description/index.html

2
odoo_website_helpdesk/__manifest__.py

@ -21,7 +21,7 @@
############################################################################ ############################################################################
{ {
'name': "Website Helpdesk Support Ticket Management", 'name': "Website Helpdesk Support Ticket Management",
'version': '17.0.1.0.2', 'version': '17.0.1.0.3',
'category': 'Website', 'category': 'Website',
'summary': """The website allows for the creation of tickets, which can 'summary': """The website allows for the creation of tickets, which can
then be controlled from the backend. Furthermore, a bill that includes then be controlled from the backend. Furthermore, a bill that includes

15
odoo_website_helpdesk/controllers/website_form.py

@ -55,6 +55,7 @@ class WebsiteFormInherit(WebsiteForm):
:return: JSON response indicating the success or failure of form submission. :return: JSON response indicating the success or failure of form submission.
:rtype: str :rtype: str
""" """
print('hiiii')
customer = request.env.user.partner_id customer = request.env.user.partner_id
lowest_stage_id = None lowest_stage_id = None
if model_name == 'ticket.helpdesk': if model_name == 'ticket.helpdesk':
@ -105,6 +106,20 @@ class WebsiteFormInherit(WebsiteForm):
'category_id': kwargs.get('category'), 'category_id': kwargs.get('category'),
} }
ticket_id = request.env['ticket.helpdesk'].sudo().create(rec_val) 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"<p>Hello {partner_create.name},</p><p>Your ticket <strong>{ticket_id.name}</strong> with the subject <strong>{ticket_id.subject}</strong> has been successfully submitted. Our support team will contact you soon.</p> <p>Thank You.</p>",
'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_number'] = ticket_id.name
request.session['ticket_id'] = ticket_id.id request.session['ticket_id'] = ticket_id.id
model_record = request.env['ir.model'].sudo().search( model_record = request.env['ir.model'].sudo().search(

6
odoo_website_helpdesk/doc/RELEASE_NOTES.md

@ -15,3 +15,9 @@
##### UPDT ##### UPDT
-A new contact record is created upon form submission. -A new contact record is created upon form submission.
#### 19.05.2025
#### Version 17.0.1.0.3
##### UPDT
-A confirmation email will be sent to the customer upon ticket creation.

2
odoo_website_helpdesk/static/description/index.html

@ -635,6 +635,8 @@
in the Thank You page that appears when the in the Thank You page that appears when the
helpdesk ticket is generated. helpdesk ticket is generated.
</p> </p>
<p style="font-weight:400; font-size:16px; line-height:150%; text-align:center; color:var(--text-color-light)">A confirmation email will be sent to the customer upon ticket creation.
</p>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save