<?xml version="1.0"?>
<search string="Search Goals">
                <filter name="my" string="My Goals" domain="[('user_id', '=', uid)]"/>
                <separator/>
                <filter name="draft" string="Draft" domain="[('state', '=', 'draft')]"/>
                <filter name="inprogress" string="Running" domain="[                         '|',                             ('state', '=', 'inprogress'),                             '&amp;',                                 ('state', 'in', ('done', 'failed')),                                 ('end_date', '&gt;=', context_today().strftime('%Y-%m-%d'))                     ]"/>
                <filter name="closed" string="Done" domain="[                         ('state', 'in', ('reached', 'failed')),                         '|',                             ('end_date', '=', False),                             ('end_date', '&lt;', context_today().strftime('%Y-%m-%d'))                     ]"/>
                <separator/>

                <field name="user_id"/>
                <field name="definition_id"/>
                <field name="challenge_id"/>
                <group expand="0" string="Group By">
                    <filter name="group_by_user" string="User" domain="[]" context="{'group_by':'user_id'}"/>
                    <filter name="group_by_definition" string="Goal Definition" domain="[]" context="{'group_by':'definition_id'}"/>
                    <filter string="State" name="state" domain="[]" context="{'group_by':'state'}"/>
                    <filter string="End Date" name="enddate" domain="[]" context="{'group_by':'end_date'}"/>
                </group>
            </search>
        