Odoo Help


how we render model form in controller in odoo v9

on 1/22/16, 7:48 AM 1,486 views


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" />





<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" />




<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.




<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>-->




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


Emipro Technologies Pvt. Ltd.

--Emipro Technologies Pvt. Ltd.--
| 6 7 8
Rajkot, India
--Emipro Technologies Pvt. Ltd.--

Being an emerging leader in IT market since 2011, Emipro Technologies Pvt. Ltd. has been providing a wide range of business solutions in Odoo & Magento. We are pleased to have a large pool of contented customers with our meticulous work in the domain of ERP & e-Commerce. A ray of relief & satisfaction to  our customers heart by our successful deployment in their organization, purely represents our success in Odoo platform. Hence, we take pride for being an Odoo partner with a vision of expanding our strategic alliances with our customers to offer them high value-added, trustworthy & cost effective solutions.


Since establishment, our business has span across 11 countries of the world. Our customers are companies of all sizes ranging from start-ups to large enterprises, who realize that they need a professional business solutions to generate revenue streams, establish proper communication channels or streamline business operations. Standing with strong determination of customer satisfaction, observing each minute detail of their business processes, providing proper guidance and moving forth to develop product accordingly adds our value and reliability among our customers. 


We are blessed with efficient, passionate & eclectic young developers who have come across almost all kinds of business profiles, working with full dedication, applying creativity & new features in existing modules and completing customer's projects successfully on predefined target. Our in-depth knowledge while giving business solutions in Odoo allows us to offer following services to our customers :


  • Consulting
  • Installation, Configuration & Customization
  • Training & Support
  • Maintenance
  • Upgradation
  • Documentation
  • Crafting community modules
  • Drafting videos on demand
  • Smart Apps development

We will be :) to welcome you @ www.emiprotechnologies.com to solve any kind of your business needs around Odoo. However we are just an inch away from you by email info@emiprotechnologies.com or a tweet to @EmiproTech

Emipro Technologies Pvt. Ltd.
On 1/22/16, 12:17 PM

 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.

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

on 2/1/16, 1:36 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/22/16, 7:48 AM
Seen: 1486 times
Last updated: 1/22/16, 12:17 PM