<?xml version="1.0"?>
<search string="Search Purchase Order">
                    <field name="order_id"/>
                    <field name="product_id"/>
                    <field name="partner_id" string="Vendor"/>
                    <filter name="hide_cancelled" string="Hide cancelled lines" domain="[('state', '!=', 'cancel')]"/>
                    <filter string="Status" name="purchase_state" domain="[('state', '=', 'purchase')]"/>
                    <separator/>
                    <filter name="filter_date_order" date="date_order" default_period="month"/>
                    <filter name="order_date_last_year" string="Order Date: Last 365 Days" domain="[                             ('date_order', '&gt;', ((context_today() - relativedelta(years=1)).strftime('%Y-%m-%d')))                         ]" invisible="1"/>
                    <group expand="0" string="Group By">
                        <filter name="groupby_supplier" string="Vendor" domain="[]" context="{'group_by' : 'partner_id'}"/>
                        <filter name="groupby_product" string="Product" domain="[]" context="{'group_by' : 'product_id'}"/>
                        <filter string="Order Reference" name="order_reference" domain="[]" context="{'group_by' :'order_id'}"/>
                        <separator/>
                        <filter string="Order Date" name="group_by_date_order" context="{'group_by': 'date_order'}"/>
                    </group>
                </search>
            