<?xml version="1.0"?>
<search string="Search Sales Order">
                <field name="name" string="Order" filter_domain="['|', '|', ('name', 'ilike', self), ('client_order_ref', 'ilike', self), ('partner_id', 'child_of', self)]"/>
                <field name="partner_id" operator="child_of"/>
                <field name="user_id"/>
                <field name="team_id" string="Sales Team"/>
                <field name="order_line" string="Product" filter_domain="[('order_line.product_id', 'ilike', self)]"/>
                <field name="activity_user_id" string="Activities of"/>
                <field name="activity_type_id" string="Activity type"/> 
                <!-- We only allow to search on the following sale order line fields (product, name) because the other fields, such as price, quantity, ...
                    will not be searched as often, and if they need to be searched it's usually in the context of products
                    and then they can be searched from the page listing the sale order lines related to a product (from the product itself).
                -->
                <filter invisible="1" string="My Activities" name="filter_activities_my" domain="[('activity_user_id', '=', uid)]"/>
                <separator invisible="1"/>
                <filter name="my_sale_orders_filter" string="My Orders" domain="[('user_id', '=', uid)]"/>
                <filter invisible="1" string="Late Activities" name="activities_overdue" domain="[('activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]" help="Show all records whose next activity date is past"/>
                <filter invisible="1" string="Today Activities" name="activities_today" domain="[('activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
                <filter invisible="1" string="Future Activities" name="activities_upcoming_all" domain="[('activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))]"/>
                <group expand="0" string="Group By">
                    <filter name="salesperson" string="Salesperson" context="{'group_by': 'user_id'}"/>
                    <filter name="customer" string="Customer" context="{'group_by': 'partner_id'}"/>
                    <filter name="order_month" string="Order Date" context="{'group_by': 'date_order'}"/>
                </group>
            </search>
        