Odoo Help


Default view filter Group and Order

on 2/29/16, 1:53 PM 3,796 views


I'm trying without success order and group by a tree view.
I defined action window with this context:

context="{'order_by':'start_datetime desc', 'group_by':'start_datetime:day'}"

I get a grouped tree view by day but not with the inverse order.

Can't group and order fields on and unfiltered view pressing header column buttons and grouping.

¿Posible bug in data.js?


Jignesh Mehta

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

- I have 3+ years of Industry Experience, specializing Odoo Development, Analysis, Customization, Implementation, Integration.
- I have done many Customization modules in Sale, Purchase, Point of Sale, Inventory, CRM and much more. Also Worked in the Odoo Themes like Business Theme or E-Commerce Theme.
- Develop Jewelery Manufacturing process from Scratch. It have more than 10 Department. Develop PDF and Excel reports for this project around 150 per format.

Jignesh Mehta
On 3/2/16, 8:14 AM

Hello Aj,

For order_by, You can write when your model is define


class CustomClass(models.Model):

     _name = 'custom.class'

     _order = 'start_datetime desc'

For group_by, You can write search record for start_datetime


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

    <field name="name">custom.class.search.view</field>

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

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

        <search string="Custom Class">       

            <filter name="group_start_datetime" string="Start time icon="terp-partner" context="{'group_by':'start_datetime'}"/>




Now You can pass in context of action as follow :-

<field name="context">{'search_default_group_start_datetime': 1}</field>

Hope it helps you.


About This Community

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


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 2/29/16, 1:53 PM
Seen: 3796 times
Last updated: 3/2/16, 8:14 AM