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.


How to change default action of elements of tree view?

on 9/6/14, 10:56 PM 1,113 views

Here's the thing, i want to go to another tree view of another module when clicking on an element of the first tree view, instead of the predetermined form view. What i tried:

        <record id="view_destination_tree" model="ir.ui.view">
                    <field name="name">delivery.destination</field>
                    <field name="model">delivery.destination</field>
                    <field name="priority">1</field>
                    <field name="arch" type="xml">
                        <tree string="Destinos">
                            <field name="coordenadas" string="Coordenadas"/>
                            <field name="client" string="Cliente"/>
                            <field name="is_default" string="Predeterminado"/>

        <record id="view_clients" model="ir.ui.view">
                    <field name="name">client.dest</field>
                    <field name="model">res.partner</field>
                    <field name="priority">1</field>
                    <field name="arch" type="xml">
                        <tree string="Clientes con Destinos">
                            <field name="name" string="Cliente"/>
                            <field name="has_destination" string="Tiene destino"/>

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

                    <field name="name">Lista de Destinos</field>

                    <field name="res_model">res.partner</field>
                    <field name="view_id" ref="view_clients"/>

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

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


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

                    <field name="name">Lista de Destinos</field>

                    <field name="res_model">delivery.destination</field>
                    <field name="view_id" ref="view_destination_tree"/>

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

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


<menuitem id="main_menu_ruta" name="Rutas"/>
            <menuitem id="Rutas" parent="main_menu_ruta" name="Rutas"/>
            <menuitem id="Destinos" parent="Rutas" action="action_tree_destination" name="Destinos"/>

I want to call action_clients when clicking in view_destination_tree. I tried some things but the clicking doesn't get me anywhere.

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)


Asked: 9/6/14, 10:56 PM
Seen: 1113 times
Last updated: 3/16/15, 8:10 AM