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.


Search View: group_by filter

René Schuster
on 1/9/14, 9:07 AM 1,446 views

I've set up a tree view and a search view for a simple model:

<record id="public_holidays_list_view" model="ir.ui.view">
             <field name="name">holidays.holidays.tree.view</field>
             <field name="model">holidays.holidays</field>
             <field name="arch" type="xml">
                    <tree string="Public Holidays" editable="bottom">
                          <field name="name"/>
                          <field name="date"/>
                          <field name="percentage"/>
                          <field name="year" invisible="1"/>

     <record id="public_holidays_search_view" model="ir.ui.view">
             <field name="name">holidays.holidays.search.view</field>
             <field name="model">holidays.holidays</field>
             <field name="arch" type="xml">
                    <search string="Public Holidays">
                            <group expand="0" string="Group By...">
                                   <filter name="group_by_year" string="Year" icon="terp-project" context="{'group_by':'year'}"/>

     <record id="open_view_public_holidays" model="ir.actions.act_window">
        <field name="name">Public Holidays</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">holidays.holidays</field>
        <field name="context">{'search_default_group_by_year': 1}</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree</field>
        <field name="view_id" eval="public_holidays_list_view"/>
        <field name="search_view_id" ref="public_holidays_search_view"/>

The records are grouped, but not displayed, even if I expand the groups.
What is happening?
Further: I'd like the standard create button to still work while in search view.

Please help.


Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 8/13/15, 4:03 AM


You must make sure year column has sufficiet value for it. You should follow existing core modules for the example.

We've added groupby expand feature on Odoo Apps.


Hope this 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

0 follower(s)


Asked: 1/9/14, 9:07 AM
Seen: 1446 times
Last updated: 8/13/15, 4:03 AM