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

How to create a form for website, without requiring a data-model - Odoo v9 community

Abonare

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

Această întrebare a fost marcată
website_crmwebsitewebsite_contactodooV9
7483 Vizualizări
Imagine profil
Alberto

Hi, I have this form on view.xml:


<template id="request_loan" name="Loan Form" customize_show="True"> <!--inherit_id="website.contactus" -->
            <t t-call="website.layout">
                <section t-attf-class="container">
                <div class="row col-md-12 text-center mt16 mb32">
                    <center><h1 style="font-family: 'Varela Round', Helvetica, Arial, sans-serif;">Request Loan</h1> </center>
                </div>
                 <div>
                    <form action="/loan_form/" method="post" data-success_page="/cashflows/" class="s_website_form form-horizontal container-fluid mt32" enctype="multipart/form-data" data-model_name="loan"> <!--data-model_name="crm.lead"-->
                        <input type="hidden" name="csrf_token" t-att-value="request.csrf_token()"/>
                        <div class="form-group form-field o_website_form_required_custom">
                            <label class="col-md-3 col-sm-4 control-label" for="contact_name_">Your Name</label>
                            <div class="col-md-7 col-sm-8">
                                <input type="text" class="form-control o_website_form_input" name="contact_name_" t-att-value="request.params.get('contact_name_', '')" required=""/>
                            </div>
                        </div>
                        <div class="form-group form-field o_website_form_required_custom">
                            <label class="col-md-3 col-sm-4 control-label" for="phone_from_">Phone</label>
                            <div class="col-md-7 col-sm-8">
                                <input type="text" class="form-control o_website_form_input" name="phone_from_'" required="" t-att-value="request.params.get('phone_from_', '')" />
                            </div>
                        </div>
                        <div class="form-group form-field o_website_form_required_custom">
                            <label class="col-md-3 col-sm-4 control-label" for="description_">Loan Request</label>
                            <div class="col-md-7 col-sm-8">
                                <textarea class="form-control o_website_form_input" name="description_" required=""><t t-esc="request.params.get('description_', '')"/></textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-md-offset-3 col-sm-offset-4 col-sm-8 col-md-7">
                                <span class="btn btn-primary btn-lg o_website_form_send">Send</span>
                                <span id="o_website_form_result"></span>
                                <a href="/cashflows/"><span class="btn btn-primary btn-lg" style="margin-left:560px; margin-top:-70px;">Back</span></a>
                                <span id=""></span>
                            </div>
                            <div class="col-md-offset-3 col-sm-offset-4 col-sm-8 col-md-7">

                            </div>
                        </div>
                    </form>
                </div>
            </section>
        </t>
        </template>


And this controller:


@http.route('/page/request_loan/', auth='public', methods=['POST'], website=True)
    def index(self, **kw):
        return http.request.render('opencloud_cashflows.request_loan', {
         })

I'm taking the contactus page as example.

But what I don't get, is why I need to validate this on a model somehow ie: data-model_name=


I've created this model for that:

class Loan(models.Model):
    _name = 'loan'

    contact_name_ = fields.Char("Nombre")
    phone_from_ = fields.Char("Phone")
    description_ = fields.Text('Loan Request Text')


But, there isnt a way to just create a form for website via module, which doesn't needs this validation?


On the original contact page, it took crm.lead as data-model, and the other weird thing is that I just can't send this email form, it says "An error has ocurred the form cannot be sent"


Any ideas?


PS = Right now it's giving me a 404 error on /page/request_loan/ , very weird.

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
How to do Autocomplete in name search on res.partner in website odoo-14
contacts website_crm website website_contact
Imagine profil
Imagine profil
1
oct. 21
5105
How to add domain in website from field? Rezolvat
website website_contact
Imagine profil
Imagine profil
1
dec. 22
5187
Standard value for "Subject" in contact form under V13
website website_contact
Imagine profil
0
sept. 22
1959
How to inherit and implement contact search function in website - Odoo 14
website website_contact
Imagine profil
0
aug. 21
3528
[8.0] website_crm additional fields from res.partner page
crm leads website_crm website website_contact
Imagine profil
0
mar. 15
3942
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