Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

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

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Website page controller. Cant see logs

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
apicontrollerswebsitewebsites
2 Besvarelser
1767 Visninger
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
Kassér
Avatar
Ansar
Forfatter Bedste svar

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
Kassér
Avatar
Anaghan Heri
Bedste svar
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
Kassér
Enjoying the discussion? Don't just read, join in!

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

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
Data from website with controller Løst
controllers website
Avatar
Avatar
Avatar
2
jul. 24
4953
How to raise 403 Error (Forbiden) and 404 error in Odoo web controller Løst
controllers website
Avatar
Avatar
Avatar
Avatar
3
apr. 24
6451
Website Flash Message
controllers website
Avatar
0
sep. 21
2695
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
3836
Inject data/variables into website controller
controllers website
Avatar
1
mar. 15
5726
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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