Odoo Help


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


Multiple Create Form Views same Model

on 8/19/16, 3:52 AM 189 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"/>' 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)


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