Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Website page controller. Cant see logs

Subscriure's

Get notified when there's activity on this post

This question has been flagged
apicontrollerswebsitewebsites
2 Respostes
1715 Vistes
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
Descartar
Avatar
Ansar
Autor 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
Descartar
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
Descartar
Enjoying the discussion? Don't just read, join in!

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

Registrar-se
Related Posts Respostes Vistes Activitat
Data from website with controller Solved
controllers website
Avatar
Avatar
Avatar
2
de jul. 24
4918
How to raise 403 Error (Forbiden) and 404 error in Odoo web controller Solved
controllers website
Avatar
Avatar
Avatar
Avatar
3
d’abr. 24
6386
Website Flash Message
controllers website
Avatar
0
de set. 21
2651
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
de gen. 21
3824
Inject data/variables into website controller
controllers website
Avatar
1
de març 15
5686
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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