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