Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

Website page controller. Cant see logs

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
apicontrollerswebsitewebsites
2 Răspunsuri
1706 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Ansar
Autor Cel mai bun răspuns

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
Imagine profil
Abandonează
Imagine profil
Anaghan Heri
Cel mai bun răspuns
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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

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

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
Data from website with controller Rezolvat
controllers website
Imagine profil
Imagine profil
Imagine profil
2
iul. 24
4916
How to raise 403 Error (Forbiden) and 404 error in Odoo web controller Rezolvat
controllers website
Imagine profil
Imagine profil
Imagine profil
Imagine profil
3
apr. 24
6383
Website Flash Message
controllers website
Imagine profil
0
sept. 21
2647
Fetching data fields from an external api and displaying them in our web page in odoo 13
external api controllers website Odoo13.0
Imagine profil
0
ian. 21
3821
Inject data/variables into website controller
controllers website
Imagine profil
1
mar. 15
5682
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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