Browse Source

Feb 17 [UPDT] : Updated 'odoo_website_helpdesk'

pull/358/merge
AjmalCybro 2 months ago
parent
commit
3a9e256075
  1. 2
      odoo_website_helpdesk/__manifest__.py
  2. 12
      odoo_website_helpdesk/controller/website_form.py
  3. 5
      odoo_website_helpdesk/doc/RELEASE_NOTES.md
  4. 8
      odoo_website_helpdesk/static/description/index.html

2
odoo_website_helpdesk/__manifest__.py

@ -21,7 +21,7 @@
################################################################################ ################################################################################
{ {
'name': "Website Helpdesk Management", 'name': "Website Helpdesk Management",
'version': '18.0.1.0.0', 'version': '18.0.1.0.1',
'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.""", then be controlled from the backend.""",

12
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. :return: JSON response indicating the success or failure of form submission.
:rtype: str :rtype: str
""" """
customer = request.env.user.partner_id
lowest_stage_id = None lowest_stage_id = None
if model_name == 'ticket.helpdesk': if model_name == 'ticket.helpdesk':
tickets = request.env['ticket.stage'].sudo().search([]) tickets = request.env['ticket.stage'].sudo().search([])
@ -69,6 +68,12 @@ class WebsiteFormInherit(WebsiteForm):
return json.dumps( return json.dumps(
{'error': "No stage found with the lowest sequence."}) {'error': "No stage found with the lowest sequence."})
products = kwargs.get('product') 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: if products:
split_product = products.split(',') split_product = products.split(',')
product_list = [int(i) for i in split_product] product_list = [int(i) for i in split_product]
@ -81,7 +86,7 @@ class WebsiteFormInherit(WebsiteForm):
'priority': kwargs.get('priority'), 'priority': kwargs.get('priority'),
'product_ids': product_list, 'product_ids': product_list,
'stage_id': lowest_stage_id.id, 'stage_id': lowest_stage_id.id,
'customer_id': customer.id, 'customer_id': partner_create.id,
'ticket_type_id': kwargs.get('ticket_type_id'), 'ticket_type_id': kwargs.get('ticket_type_id'),
'category_id': kwargs.get('category'), 'category_id': kwargs.get('category'),
} }
@ -94,10 +99,11 @@ class WebsiteFormInherit(WebsiteForm):
'phone': kwargs.get('phone'), 'phone': kwargs.get('phone'),
'priority': kwargs.get('priority'), 'priority': kwargs.get('priority'),
'stage_id': lowest_stage_id.id, 'stage_id': lowest_stage_id.id,
'customer_id': customer.id, 'customer_id': partner_create.id,
'ticket_type_id': kwargs.get('ticket_type_id'), 'ticket_type_id': kwargs.get('ticket_type_id'),
'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)
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

5
odoo_website_helpdesk/doc/RELEASE_NOTES.md

@ -5,3 +5,8 @@
#### ADD #### ADD
- Initial commit for Website Helpdesk Support Ticket Management - 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.

8
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"> 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 Community
</div> </div>
<div class="text-center"
style="background-color:#875A7B !important; color:#fff !important; font-size:0.8rem !important; font-weight:500 !important; padding:4px !important; margin:0 3px !important; border-radius:50px !important; min-width:120px !important">
Enterprise
</div>
<div class="text-center"
style="background-color:#7C7BAD !important; color:#fff !important; font-size:0.8rem !important; font-weight:500 !important; padding:4px !important; margin:0 3px !important; border-radius:50px !important; min-width:120px !important">
Odoo.sh
</div>
</div> </div>
<div class="tab-content" id="myTabContent"> <div class="tab-content" id="myTabContent">
<!-- description --> <!-- description -->

Loading…
Cancel
Save