Odoo Help

Welcome!

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.

0

Tree View is not displaying? odoo9

By
Undan
on 7/21/16, 9:32 AM 170 views

Here below is the code.On saving the form it saves, But when i clicked on the tree view the form which i created was not there..it not showing any thing..Why it is not fetching from database??


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

    <field name="name">demo.view.tree</field>

    <field name="model">demo.view</field>

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

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

        <tree string=" View" >

            <field name="project_name"/>

            <field name="code"/>

         </tree>

    </field>

</record>

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

        <field name="name">demo.view.form</field>

        <field name="model">demo.view</field>

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

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

        <form string="Sample">

            <sheet>

            <group>

                <field name="project_name" />

                    <field name="code"/>

               </group>

            </sheet>

        </form>

    </field>

</record>

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

        <field name="name">Projects</field>

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

        <field name="res_model">demo.view</field>

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

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

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

        <p class="oe_view_nocontent_create">

        Click to enter .

        </p><p>

        Use this menu to enter the details .

        </p>

        </field>

</record>

I have tried this too . and also created a Create function for this model.then also tree view showing nothing and when i tried to access the database it showing some kind of access errors and all

Undan
on 7/22/16, 4:54 AM
0
tchigy
On 7/21/16, 4:47 PM

When you want to show a model in mutiple view_mode : like tree,form,kanban  use this to specify the view_ids for the action because when you have multiple tree views for the model odoo choses the default one :


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

<field name="name">Projects</field>

<field name="res_model">demo.view</field>

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

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

<field name="view_ids"

eval="[(5, 0, 0),

(0, 0, {'view_mode': 'tree', 'view_id': ref('demo_view_tree_view')}),

(0, 0, {'view_mode': 'form'}),

]"

/>

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

<p class="oe_view_nocontent_create"> Click to enter . </p><p> Use this menu to enter the details .</p>

</field>

</record>

I have tried this too . and also created a Create function for this model.then also tree view showing nothing and when i tried to access the database it showing some kind of access errors and all

Undan
on 7/22/16, 4:55 AM
0
Tuan
On 7/21/16, 10:26 AM

In the defined of action, you have to define the tree mode into view_mode as bellow


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


hope it helps

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

1 follower(s)

Stats

Asked: 7/21/16, 9:32 AM
Seen: 170 times
Last updated: 7/21/16, 4:47 PM