Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

Website page controller. Cant see logs

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
apicontrollerswebsitewebsites
2 Réponses
2455 Vues
Avatar
Ansar Latif

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
Ignorer
Avatar
Ansar Latif
Auteur Meilleure réponse

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
Ignorer
Avatar
Anaghan Heri
Meilleure réponse
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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
Data from website with controller Résolu
controllers website
Avatar
Avatar
Avatar
2
juil. 24
6306
How to raise 403 Error (Forbiden) and 404 error in Odoo web controller Résolu
controllers website
Avatar
Avatar
Avatar
Avatar
3
avr. 24
7995
Website Flash Message
controllers website
Avatar
0
sept. 21
3677
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
janv. 21
4513
Inject data/variables into website controller
controllers website
Avatar
1
mars 15
6995
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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