Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

Website page controller. Cant see logs

Naroči se

Get notified when there's activity on this post

This question has been flagged
apicontrollerswebsitewebsites
2 Odgovori
1662 Prikazi
Avatar
Ansar

This is my controller for view create ticket page

class WebsiteMeeting(http.Controller): 

@http.route ([ '/schedule' ], type = 'http' , auth = "user" , methods = [ 'GET' ], website = True )
def schedule ( self , * *kw ):
ticket_types_ob = request.env[ 'helpdesk.ticket.type' ].sudo().search([])
ticket_types = []
for ttp in ticket_types_ob:
ticket_types.append([ttp.id,ttp.name])
values ​​= {
'website' : request.website,
'members' : [],
'ticket_types' : ticket_types,
}
return request.render( 'website_home_page.create_ticket ' , values)


This is the template

<template id ="create_ticket" name ="Create a Ticket" > 
<t t-call ="website.layout" >
<div id ="wrap" >
<div class ="oe_structure" >
<section class ="s_title parallax s_parallax_is_fixed bg-black-50 pt24 pb24" data-vcss ="001"
data-snippet ="s_title" data-scroll-background-ratio ="1" >
<span class ="s_parallax_bg oe_img_bg"
style ="background-image: url('/web/image/website.s_banner_default_image'); background-position: 50% 0;" />
<div class ="o_we_bg_filter bg-black-50" />
<div class ="container" >
<h1> Create a Ticket </h1>
</div>
</section>
</div>
<div class = "container mt-4 mb-5" >
<div class ="row" >
<div class ="col-lg-12 col-xl-12 mr-lg-auto" >
<div class ="oe_structure" >
<section class ="s_text_block" data-snippet ="s_text_block" >
<div class ="container" >
<div class ="row" >
<div class ="col-lg-12" >
<p>
Schedule the meeting with our representative after checking their
availability in your time zone.
</p>
</div>
</div>
</div>
</section>
</div>
<div id ="create_ticket_section" >
<section id ="website_meeting_form" class ="s_website_form" data-vcss="001"
data-snippet ="s_website_form" >
<div class ="container" >


<form id ="create-ticket-form" action ="/ticket_public/" method ="post"
enctype ="multipart/form- data" class ="o_mark_required" data-mark ="*"
data-model_name ="helpdesk.ticket" data-success-mode ="redirect"
data-success-page ="/meetings-thank-you" >
<div class ="s_website_form_rows row s_col_no_bgcolor" >
<div class ="form-group col-12 s_website_form_field s_website_form_custom s_website_form_required"
data-type ="char" data-name ="Field" >
<div class ="row s_col_no_resize s_col_no_bgcolor" >
<label class ="col-form-label col-sm-auto s_website_form_label"
style ="width:200px" for ="subject" >
< span class = "s_website_form_label_content" > Subject </span>
<span class ="s_website_form_mark" > * </span>
</label>
<div class ="col-sm" >
<input id ="subject" type ="text"
class ="form-control s_website_form_input" name ="name"
required ="" />
</div>
</div>
</div>

<div class ="form-group col-12 s_website_form_field s_website_form_custom"
data-type ="char" data-name ="Field" >
<div class="row s_col_no_resize s_col_no_bgcolor" >
<label class ="col-form-label col-sm-auto s_website_form_label"
style ="width: 200px" for ="issue_type" >
<span class ="s_website_form_label_content" > Issue Type </span >
<span class ="s_website_form_mark" > * </span>
</label>
<div class ="col-sm" >
<select id ="issue_type"
class ="form-control s_website_form_input set-issue-type"
name = "issue_type" required ="" >
<t t-foreach ="ticket_types" t-as ="ttp" >
<option t-att-value ="ttp[0]" >
<t t-esc ="ttp[1 ]" />
</option>
</t>
</select>
</div>
</div>
</div>

<div class ="form-group col-12 s_website_form_field s_website_form_custom"
data-type ="char" data-name ="Field" >
<div class ="row s_col_no_resize s_col_no_bgcolor" >
<label class ="col- form-label col-sm-auto s_website_form_label"
style ="width:200px" for ="description" >
<span class ="s_website_form_label_content" > Description
</span>
<span class ="s_website_form_mark" > * </span>
</label>
<div class ="col-sm md" >
<textarea id ="description" rows ="7"
class ="form-control s_website_form_description load_editor"
name ="description" required ="" />

</div>
</div>
</div>
<div class ="form-group col-12 s_website_form_field s_website_form_custom"
data-type ="char" data-name ="Field" >
<div class ="row s_col_no_resize s_col_no_bgcolor" >
<label class ="col-form-label col-sm-auto s_website_form_label"
style ="width: 200px" for ="description" >
<span class ="s_website_form_label_content" > Attachments
</span>
</label>
<div class ="col-sm" >
<div id ="attachment-tickets" class ="dropzone" >
</div>

</div>
</div>
</div>


<div class ="form-group col -12 s_website_form_submit"
data-name ="Submit Button" >
<div style ="width:200px;" class ="s_website_form_label" >
<span id ="s_website_form_result" ></span>
</div> <a id ="s_website_form_send" href ="#" role ="button" class ="btn btn-primary btn-lg s_website_form_send" >
Submit </a> </div> </div> </form > <script type ="text/javascript" src ="/knk_portal_tasks/static/src/js/dropzone_params.js" ></script> </div> </section> </div> </div> </div > </div> <div class ="oe_structure mt-2" /> </div> </t> </template>
This is the menu and page
<record id="schedule_page" model="website.page">
<field name="is_published">True</field>
<field name="url">/schedule</field>
<field name="view_id" ref="website_home_page.create_ticket"/>
<field name="track">True</field>
<field name="website_meta_description">This is the test page of the website</field>
</record>

<record id="menu_schedule_meeting1" model="website.menu">
<field name="name">Create a Ticket</field>
<field name="url">/schedule</field>
<field name="parent_id" ref="website.main_menu"/>
<field name="sequence" type="int">70</field>
</record>

It seems the api in the controllers /schedule is not being hit. Because when i hit /schedule i see the page loaded but no logs being shown also values and tickets_types are not visible

0
Avatar
Opusti
Avatar
Ansar
Avtor Best Answer

Problem I cant even see the logs

@http.route ([ '/schedule' ], type = 'http' , auth = "user" , website = True ) 
def schedule ( self , **kw ):
_logger.info( "------- -- KNKDIS parent TEST -----" )
ticket_types_ob = request.env[ 'sh.helpdesk.ticket.type' ].sudo().search([])
ticket_types = []
for ttp in ticket_types_ob:
ticket_types.append ([ttp.id,ttp.name])
values ​​= {
'website' : request.website,
'members' : [],
'ticket_types' : ticket_types,
}
return request.render( 'website_home_page.create_ticket' , values)
0
Avatar
Opusti
Avatar
Anaghan Heri
Best Answer
You can try like this 


ticket_types_ob = request.env[ 'helpdesk.ticket.type' ].sudo().search([])
values ​​= {
'website' : request.website,
'members' : [],
'ticket_types' : ticket_types_ob,
}
 <t t-foreach ="ticket_types" t-as ="type" > 
<option t-att-value ="type.id" >
<t t-esc ="type.name" />
</option>
</t> ​ ​ ​


0
Avatar
Opusti
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Related Posts Odgovori Prikazi Aktivnost
Data from website with controller Solved
controllers website
Avatar
Avatar
Avatar
2
jul. 24
4867
How to raise 403 Error (Forbiden) and 404 error in Odoo web controller Solved
controllers website
Avatar
Avatar
Avatar
Avatar
3
apr. 24
6253
Website Flash Message
controllers website
Avatar
0
sep. 21
2599
Fetching data fields from an external api and displaying them in our web page in odoo 13
external api controllers website Odoo13.0
Avatar
0
jan. 21
3743
Inject data/variables into website controller
controllers website
Avatar
1
mar. 15
5597
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now