<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="view_report_pos_order_graph" model="ir.ui.view">
            <field name="name">report.pos.order.graph</field>
            <field name="model">report.pos.order</field>
            <field name="arch" type="xml">
                <graph string="Point of Sale Analysis" type="pivot">
                    <field name="product_categ_id" type="row"/>
                    <field name="date" interval="month" type="col"/>
                    <field name="product_qty" type="measure"/>
                    <field name="price_total" type="measure"/>
                </graph>
            </field>
        </record>

        <record id="view_report_pos_order_search" model="ir.ui.view">
            <field name="name">report.pos.order.search</field>
            <field name="model">report.pos.order</field>
            <field name="arch" type="xml">
                <search string="Point of Sale Analysis">
                    <field name="date"/>
                    <filter string="Invoiced" domain="[('state','=',('invoiced'))]"/>
                    <filter string="Not Invoiced" domain="[('state','=',('paid'))]"/>
                    <separator/>
                    <filter string="Year" name="year" domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;=',time.strftime('%%Y-01-01'))]" help="POS ordered created during current year"/>
                    <separator/>
                    <filter string="My Sales" help="My Sales" domain="[('user_id','=',uid)]"/>
                    <field name="partner_id"/>
                    <field name="user_id"/>
                    <field name="partner_id"/>
                    <field name="user_id"/>
                    <group expand="1" string="Group By">
                        <filter string="Salesperson" name="User" context="{'group_by':'user_id'}"/>
                        <filter string="Product Category" context="{'group_by':'product_categ_id'}"/>
                        <filter string="Product" context="{'group_by':'product_id'}"/>
                        <separator/>
                        <filter string="Order Month" context="{'group_by':'date:month'}" help="Month of order date"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="action_report_pos_order_all" model="ir.actions.act_window">
            <field name="name">Orders Analysis</field>
            <field name="res_model">report.pos.order</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph</field>
            <field name="search_view_id" ref="view_report_pos_order_search"/>
            <field name="context">{'group_by_no_leaf':1,'group_by':[]}</field>
        </record>

        <menuitem action="action_report_pos_order_all" id="menu_report_pos_order_all" parent="menu_point_rep" sequence="3"/>
    </data>
</openerp>
