Odoo Help


Multiple Create Form Views same Model

on 8/19/16, 3:52 AM 2,094 views


I have Sales Order model and Sales Order model with additional fields. I use them in different ways.

One sales order must stay default, another have additional fields.

I have created another Menu and Tree View. 

I cannot find how may i change Form View that is beeing opened after clicking "Create" in Tree view. ?

Ajeet Yadav
On 8/19/16, 5:32 AM

You can define different tree view,form view actions for models. Below code may be help you.

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

    <field name="name">Hotel Invoices</field>

    <field name="res_model">account.invoice</field>

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

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

    <field eval="False" name="view_id"/>

    <field name="domain">[('type','in',('out_invoice', 'out_refund')),('is_hotel_invoice','=',True)]</field>

    <field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>

    <field name="search_view_id" ref="account.view_account_invoice_filter"/>


<record id="action_hotel_invoice_tree1_view1" model="ir.actions.act_window.view">

    <field eval="1" name="sequence"/>

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

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

    <field name="act_window_id" ref="action_hotel_invoice_tree1"/>


<record id="action_hotel_invoice_tree1_view2" model="ir.actions.act_window.view">

    <field eval="2" name="sequence"/>

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

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

    <field name="act_window_id" ref="action_hotel_invoice_tree1"/>


<menuitem  name="Hotel Invoice" id="menu_hotel_invoices"  action="action_hotel_invoice_tree1"   parent="menu_hotel_reservation"/>' 

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

2 follower(s)


Asked: 8/19/16, 3:52 AM
Seen: 2094 times
Last updated: 8/19/16, 5:35 AM