<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="view_report_cash_register_tree" model="ir.ui.view">
	        <field name="name">report.cash.register.tree</field>
	        <field name="model">report.cash.register</field>
	        <field name="type">tree</field>
	        <field name="arch" type="xml">
	            <tree string="Point of Sale Cash Register Analysis">
	                <field name="date" invisible="1"/>
	                <field name="user_id" invisible="1"/>
	                <field name="state" invisible="1"/>
	                <field name="year" invisible="1"/>
	                <field name="month" invisible="1"/>
	                <field name="day" invisible="1"/>
	                <field name="journal_id" invisible="1"/>
	                <field name="balance_start" />
	                <field name="balance_end_real" />
	            </tree>
	        </field>
        </record>

        <record id="view_report_cash_register_search" model="ir.ui.view">
	        <field name="name">report.cash.register.search</field>
	        <field name="model">report.cash.register</field>
	        <field name="type">search</field>
	        <field name="arch" type="xml">
	            <search string="Point of Sale Cash Register Analysis">
	                <group>
	                    <filter icon="terp-go-year" string="Year"
	                        domain="[('year','=',time.strftime('%%Y'))]"
	                        help="Cash Analysis created during this year"/>
	                    <filter icon="terp-go-month" string="Month"
	                        domain="[('month','=',time.strftime('%%m'))]"
	                        help="Cash Analysis created in current month"/>
	                    <filter icon="terp-go-month"
	                         string="Month -1"
	                         separator="1"
	                         domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
	                         help="Cash Analysis created in last month"/>
	                    <separator orientation="vertical"/>
	                    <filter icon="terp-go-today"
                             string="    Today    "
                             name="today"
                             separator="1"
                             domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d'))]"
                             help="Cash Analysis created by today"/>	                    
	                    <separator orientation="vertical"/>
                        <filter icon="terp-document-new"
                            string="Draft"
                            domain="[('state','=',('draft'))]"/>
	                    <filter icon="terp-camera_test"
	                        string="Confirm"
	                        domain="[('state','=',('confirm'))]"/>
                        <separator orientation="vertical"/>
                        <field name="user_id" widget="selection">
                        <filter icon="terp-personal"
                            string="My Sales"
                            help="My Sales"
                            domain="[('user_id','=',uid)]"/>
                        </field>
                    </group>  
                    <newline/>
	                <group expand="1" string="Group By..." colspan="10" col="12">
	                    <filter string="User" name="User" icon="terp-personal" context="{'group_by':'user_id'}"/>
	                    <filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>
                        <separator orientation="vertical"/>
                        <filter string="state" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
	                    <separator orientation="vertical"/>
                        <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}" help="Day from Creation date of register"/>
                        <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}" help="Month from Creation date of register"/>
                        <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}" help="Year from Creation date of register"/>
	                </group>                                  
	            </search>
	        </field>
        </record>

        <record id="action_report_cash_register_all" model="ir.actions.act_window">
	        <field name="name">Register Analysis</field>
	        <field name="res_model">report.cash.register</field>
	        <field name="view_type">form</field>
	        <field name="view_mode">tree,form</field>
	        <field name="search_view_id" ref="view_report_cash_register_search"/>
	        <field name="context">{'search_default_today':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
	    </record>

	    <menuitem action="action_report_cash_register_all" id="menu_report_cash_register_all" parent="menu_point_rep" sequence="1"/>
	</data>
</openerp>
