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

how we render model form in controller in odoo v9

Subscriure's

Get notified when there's activity on this post

This question has been flagged
modelscontrollersodooV9
3 Respostes
8958 Vistes
Avatar
kartik

hi,

i created one module in odoo v9 ,i created model for that now i want to serve this form in website with appropriate route so how can i do that in odoo.

i tried that create one controller with route and in template i added form 

my controller.py is like


@http.route('/change_mod/new/', website=True)

def add_model(self):

return request.render('change_address_model.add_model')


my view.xml is like


<record id="change_address_model_form" model="ir.ui.view">

<field name="name">change.address.model.form</field>

<field name="model">consulate.changeaddressmodel</field>

<field name="arch" type="xml">

<form string="ChangeAddressModel" version="9.0">

<group col="2">

<field name="partner_id" />

<field name="old_address" />

<field name="home_tel" />

</group>

</form>

</field>

</record>

<record id="change_of_address_model_tree" model="ir.ui.view">

<field name="name">change.address.model.tree</field>

<field name="model">consulate.changeaddressmodel</field>

<field name="arch" type="xml">

<tree string="ChangeAddressModel">

<field name="partner_id" />

<field name="old_address" />

<field name="home_tel" />

</tree>

</field>

</record>

<record model="ir.actions.act_window" id="action_change_of_address_model">

<field name="name">Change of Address Model Form</field>

<field name="type">ir.actions.act_window</field>

<field name="res_model">consulate.changeaddressmodel</field>

<field name="view_type">form</field>

<field name="view_mode">tree,form</field>

<field name="view_id" ref="change_of_address_tree"/>

<field name="help" type="html">

<p class="oe_view_nocontent_create">

Click here to create a Change of Address Model Form.

</p>

</field>

</record>

<record model="ir.ui.view" id="change_of_address_search">

<field name="name">change.of.address.model.search</field>

<field name="model">consulate.changeaddressmodel</field>

<field name="arch" type="xml">

<search string="Change of Address Model">

<field name="partner_id" />

<field name="old_address" />

<field name="home_tel" />

<!--<t t-if="partner_id.name"><field name="partner_id.name" /></t>-->

</search>

</field>

</record>


after thta when i go to that route so it not render form properly in odoo

so how can i do that in odoo

please help,

thanks in advance





0
Avatar
Descartar
Avatar
SSS
Best Answer

@kartik can you find any solution. I have same issue. If you find any solution please let me know.

0
Avatar
Descartar
Avatar
Emipro Technologies Pvt. Ltd.
Best Answer

 You cannot add view in a template. Template itself are the rendering element used to display data on the website page. Try looking at the website_sale module to get more idea about templates.

0
Avatar
Descartar
kartik
Autor

hi, Thanks for your response. i have gone through website_sale module try to render the form but it was not working. can you please specify in more detail which portion of code of website_sale module is used for rendering element on website page . please note : I am trying to render odoo model form in website page not in odoo admin dashboard please help me in that

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
Need help in new controller for new model and module. Always KeyError in return from controller to model Solved
models download controllers
Avatar
Avatar
2
d’ag. 17
6735
Custom Model show on Website Solved
models website odooV9
Avatar
Avatar
1
d’oct. 16
7368
Custom module form : It return 403 : forbiden after submit form Solved
form controllers odooV9
Avatar
Avatar
1
de febr. 16
6299
how we use file upload field in wtform in odoo controller
form controllers odooV9
Avatar
0
de gen. 16
5526
ImportError: cannot import name controllers, why? Solved
v8 import models controllers
Avatar
Avatar
Avatar
2
de des. 23
45495
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