diff --git a/odoo_website_helpdesk/__manifest__.py b/odoo_website_helpdesk/__manifest__.py index c568b23dc..4fe34b9cf 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.0', + 'version': '18.0.1.0.1', '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 6a53e8fc9..45e7de875 100644 --- a/odoo_website_helpdesk/controller/website_form.py +++ b/odoo_website_helpdesk/controller/website_form.py @@ -55,7 +55,6 @@ class WebsiteFormInherit(WebsiteForm): :return: JSON response indicating the success or failure of form submission. :rtype: str """ - customer = request.env.user.partner_id lowest_stage_id = None if model_name == 'ticket.helpdesk': tickets = request.env['ticket.stage'].sudo().search([]) @@ -69,6 +68,12 @@ class WebsiteFormInherit(WebsiteForm): return json.dumps( {'error': "No stage found with the lowest sequence."}) products = kwargs.get('product') + partner_create = request.env['res.partner'].sudo().create({ + 'name': kwargs.get('customer_name'), + 'company_name': kwargs.get('company'), + 'phone': kwargs.get('phone'), + 'email': kwargs.get('email_from') + }) if products: split_product = products.split(',') product_list = [int(i) for i in split_product] @@ -81,7 +86,7 @@ class WebsiteFormInherit(WebsiteForm): 'priority': kwargs.get('priority'), 'product_ids': product_list, 'stage_id': lowest_stage_id.id, - 'customer_id': customer.id, + 'customer_id': partner_create.id, 'ticket_type_id': kwargs.get('ticket_type_id'), 'category_id': kwargs.get('category'), } @@ -94,10 +99,11 @@ class WebsiteFormInherit(WebsiteForm): 'phone': kwargs.get('phone'), 'priority': kwargs.get('priority'), 'stage_id': lowest_stage_id.id, - 'customer_id': customer.id, + 'customer_id': partner_create.id, 'ticket_type_id': kwargs.get('ticket_type_id'), 'category_id': kwargs.get('category'), } + ticket_id = request.env['ticket.helpdesk'].sudo().create(rec_val) request.session['ticket_number'] = ticket_id.name request.session['ticket_id'] = ticket_id.id diff --git a/odoo_website_helpdesk/doc/RELEASE_NOTES.md b/odoo_website_helpdesk/doc/RELEASE_NOTES.md index f59fc806d..9f6bf0458 100644 --- a/odoo_website_helpdesk/doc/RELEASE_NOTES.md +++ b/odoo_website_helpdesk/doc/RELEASE_NOTES.md @@ -5,3 +5,8 @@ #### ADD - Initial commit for Website Helpdesk Support Ticket Management + +#### 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 diff --git a/odoo_website_helpdesk/static/description/index.html b/odoo_website_helpdesk/static/description/index.html index c08eb29c1..d444fe44a 100644 --- a/odoo_website_helpdesk/static/description/index.html +++ b/odoo_website_helpdesk/static/description/index.html @@ -99,14 +99,6 @@ style="background-color:#017E84 !important; font-size:0.8rem !important; color:#fff !important; font-weight:500 !important; padding:4px !important; margin:0 3px !important; border-radius:50px !important; min-width:120px !important"> Community -