<?xml version="1.0"?>
<search string="Email Search">
                    <field name="email_from" filter_domain="['|', '|',('email_from','ilike',self), ('email_to','ilike',self), ('subject','ilike',self)]" string="Email"/>
                    <field name="date"/>
                    <filter name="received" string="Received" domain="[('state','=','received')]"/>
                    <filter name="outgoing" string="Outgoing" domain="[('state','=','outgoing')]"/>
                    <filter name="sent" string="Sent" domain="[('state','=','sent')]"/>
                    <filter name="exception" string="Failed" domain="[('state','=','exception')]"/>
                    <separator/>
                    <filter name="filter_type_email_outgoing" string="Outgoing Email" domain="[('message_type','=','email_outgoing')]"/>
                    <filter name="filter_type_email" string="Incoming Email" domain="[('message_type','=','email')]"/>
                    <filter name="filter_type_comment" string="Comment" domain="[('message_type','=','comment')]"/>
                    <filter name="filter_type_notification" string="Notification" domain="[('message_type','=','notification')]"/>
                    <group expand="0" string="Extended Filters...">
                        <field name="author_id"/>
                        <field name="recipient_ids"/>
                        <field name="model"/>
                        <field name="res_id"/>
                    </group>
                    <group expand="0" string="Group By">
                        <filter string="Status" name="status" domain="[]" context="{'group_by':'state'}"/>
                        <filter string="Author" name="author" context="{'group_by':'author_id'}"/>
                        <filter string="Thread" name="thread" domain="[]" context="{'group_by':'message_id'}"/>
                        <filter string="Date" name="month" help="Creation Date" domain="[]" context="{'group_by':'date'}"/>
                    </group>
                </search>
            