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.


Add "Group By" to Tree View

Alex Gallien
on 10/17/16, 9:36 PM 95 views


I have a custom module in odoo8 called "DMR". In this, I have a Tree View:


I would like to add a "Group By" feature next to "Favorites" and "Filters", to group by a combination of 1. Customer 2. Defect Code 3.Disposition Code. 4.Date 5.Process

Is there any documentation to help me out here?

Thank you.

Ajeet Yadav
On 10/18/16, 6:33 AM


You need to define search view for your model.

Below link will help you-



Jignesh Mehta

--Jignesh Mehta--
| 6 4 8
Surat, India
--Jignesh Mehta--

Jignesh Mehta
On 10/17/16, 11:56 PM

Hello Alex,

For add group by, you need to add search view in the xml file.

For Ex :-

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

    <field name="name">dmr.search.view</field>   

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

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

        <search string="DMR">           

            <filter name="group_customer_id" string="Customer" icon="terp-partner" context="{'group_by':'field_name'}"/>       




After adding search record, you need to add search_view_id in action.

For Ex :-

In action,

<field name="search_view_id" ref="dmr_search_view"/>

Hope it works for you.


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: 10/17/16, 9:36 PM
Seen: 95 times
Last updated: 10/18/16, 6:33 AM