<?xml version="1.0"?>
<openerp>
   <data>

    <record model="ir.ui.view" id="view_report_auction_tree">
        <field name="name">Auction's Summary</field>
        <field name="model">report.auction</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Auction Summary tree view">
                <field name="date" invisible="1"/>
                <field name="user_id" invisible="1"/>
                <field name="year" invisible="1"/>
                <field name="day" invisible="1"/>
                <field name="month" invisible="1"/>
                <field name="auction" select="1" invisible="1"/>
                <field name="buyer_login" select="1" invisible="1"/>
                <field name="buyer" select="1" invisible="1"/>
                <field name="seller" invisible="1"/>
                <field name="object" select="1" invisible="1"/>
                <field name="state" select="1" invisible="1"/>
                <field name="lot_type" select="1" invisible="1"/>
                <field name="avg_estimation" />
                <field name="avg_price" select="1"/>
                <field name="gross_revenue" />
                <field name="net_revenue" />
                <field name="net_margin" />
                <field name="total_price" select="1"/>
            </tree>
        </field>
    </record>

    <record id="view_report_auction_search" model="ir.ui.view">
        <field name="name">report.auction.search</field>
        <field name="model">report.auction</field>
        <field name="type">search</field>
        <field name="arch" type="xml">
            <search string="Auction Summary">
                <group>
                    <filter icon="terp-go-year" string="  365 Days  "
                        domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')),('date','&gt;',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
                        help="Auction in last 365 days"/>
                    <filter icon="terp-go-month" string="   30 Days   "
                        name="month"
                        domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
                        help="Auction in last 30 days"/>
                    <filter icon="terp-go-week"
                         string="    7 Days    "
                         separator="1"
                         domain="[('date','&lt;=', time.strftime('%%Y-%%m-%%d')), ('date','&gt;',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
                         help="Auction during last 7 days"/>
                    <separator orientation="vertical"/>
                    <filter icon="terp-document-new"
                        string="Draft"
                        domain="[('state','=','draft')]"/>
                    <filter icon="terp-dolar"
                        string="Sold"
                        domain="[('state','=', 'sold')]"/>
                    <separator orientation="vertical"/>
                    <field name="auction"/>
                    <field name="user_id" widget="selection">
                       <filter icon="terp-personal"
                            string="My Auction"
                            help="My Auction"
                            domain="[('user_id','=',uid)]"/>
                    </field>
                    <field name="object"/>
                    <field name="state"/>
                    <field name="lot_type"/>
                </group>
                <newline/>
                <group expand="1" string="Group By..." colspan="10" col="12">
                    <filter string="User" icon="terp-personal" name="User" context="{'group_by':'user_id'}"/>
                    <filter string="Buyer" icon="terp-personal" name="buyer" context="{'group_by':'buyer'}"/>
                    <filter string="Seller" icon="terp-personal" name="seller" context="{'group_by':'seller'}"/>
                    <separator orientation="vertical"/>
                    <filter string="Auction" icon="terp-project" name="auction" context="{'group_by':'auction'}"/>
                    <separator orientation="vertical" />
                    <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
                    <filter string="Type"
                         icon="terp-stock_symbol-selection"
                         help="Object Category" domain="[]"
                         context="{'group_by':'lot_type'}"/>
                    <separator orientation="vertical"/>
                    <filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
                    <filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
                    <filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
                </group>
            </search>
        </field>
    </record>

    <record id="view_report_auction_graph" model="ir.ui.view">
         <field name="name">report.auction.graph</field>
         <field name="model">report.auction</field>
         <field name="type">graph</field>
         <field name="arch" type="xml">
             <graph string="Auction's Summary" type="bar">
                 <field name="auction"/>
                 <field name="total_price" operator="+"/>
                 <field name="avg_estimation" operator="+"/>
                 <field name="avg_price" operator="+"/>
                 <field name="gross_revenue" operator="+"/>
                <field name="net_revenue" operator="+"/>
                <field name="net_margin" operator="+"/>
             </graph>
         </field>
    </record>

    <record model="ir.actions.act_window" id="action_report_auction">
        <field name="name">Auction Analysis</field>
        <field name="res_model">report.auction</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,graph</field>
        <field name="search_view_id" ref="view_report_auction_search"/>
        <field name="context">{'search_default_month':1}</field>
    </record>

    <menuitem name="Auction Analysis" action="action_report_auction" id="menu_report_auction" parent="auction.auction_report_menu"/>

<!--end : creating buyer Reporting menu for the buyer by pmo-->


=============================
Objects per Day
==============================
    <record model="ir.ui.view" id="view_report_auction_object_date_tree">
       <field name="name">Objects by date</field>
       <field name="model">report.auction.object.date</field>
        <field name="type">tree</field>
            <field name="arch" type="xml">
            <tree string="Objects per Day">
                <field name="month" select="1" />
                <field name="user_id" select="1"/>
                <field name="obj_num"/>
                <field name="name" />
            </tree>
        </field>
     </record>

     <record model="ir.ui.view" id="view_report_auction_object_date_form">
        <field name="name">Object date</field>
        <field name="model">report.auction.object.date</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Objects per Day">
                <field name="user_id" />
                <field name="name" select="1"/>
                <field name="obj_num" />
                <field name="month" select="1"/>
             </form>
         </field>
     </record>

    <record model="ir.ui.view" id="view_report_auction_object_date_graph">
        <field name="name">report.auction.object.date.graph</field>
        <field name="model">report.auction.object.date</field>
        <field name="type">graph</field>
        <field name="arch" type="xml">
            <graph string="Objects per day"  type="bar">
                <field name="name" select="1"/>
                <field name="obj_num" operator="+"/>
                <field name="user_id" group="True"/>
            </graph>
        </field>
    </record>


    <record model="ir.actions.act_window" id="action_report_auction_object_date_tree_my">
        <field name="res_model">report.auction.object.date</field>
        <field name="view_type">form</field>
        <field name="view_mode">graph,tree</field>
        <field name="domain">[('user_id','=',uid),('month','=',time.strftime('%Y-%m-01'))]</field>
    </record>
    <record model="ir.actions.act_window" id="action_report_auction_object_date_tree">
        <field name="res_model">report.auction.object.date</field>
        <field name="view_type">form</field>
        <field name="view_mode">graph,tree</field>
        <field name="domain">[('month','=',time.strftime('%Y-%m-01'))]</field>
    </record>

=============================
Auction adjudication
==============================

    <record model="ir.ui.view" id="view_report_auction_adjudication_tree">
        <field name="name">report.auction.adjudication.tree</field>
        <field name="model">report.auction.adjudication</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Total adjudication">
                <field name="name" select="1"/>
                <field name="adj_total" select="1"/>
                <field name="state" select="1"/>
            </tree>
        </field>
    </record>

    <record model="ir.ui.view" id="view_report_auction_adjudication_graph">
        <field name="name">report.auction.adjudication.graph</field>
        <field name="model">report.auction.adjudication</field>
        <field name="type">graph</field>
        <field name="arch" type="xml">
            <graph string="Total adjudication" type="bar">
                <field name="name" select="1"/>
                <field name="adj_total" select="1" />
                <field name="user_id" group="True"/>
            </graph>
        </field>
    </record>

    <record model="ir.actions.act_window" id="action_report_auction_adjudication_tree">
        <field name="res_model">report.auction.adjudication</field>
        <field name="view_type">form</field>
        <field name="view_mode">graph,tree</field>
    </record>

=============================
Object encoded
==============================

    <record model="ir.ui.view" id="view_report_object_encoded_tree">
        <field name="name">report.object.encoded.tree</field>
        <field name="model">report.object.encoded</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Objects statistics">
                <field name="user_id" select="1"/>
                <field name="state" select="1"/>
                <field name="estimation" />
                <field name="obj_ret" />
                <field name="obj_num" sum="# objects" select="1"/>
                <field name="adj" sum="Total adj."/>
                <field name="obj_margin" />
                <field name="net_revenue"  sum="Total net rev."/>
                <field name="gross_revenue"  sum="Total gross rev."/>
                <field name="date" select="1"/>
            </tree>
        </field>
    </record>

    <record model="ir.ui.view" id="view_report_object_encoded_graph">
        <field name="name">report.object.encoded.graph</field>
        <field name="model">report.object.encoded</field>
        <field name="type">graph</field>
        <field name="arch" type="xml">
            <graph string="Object statistic" type="bar">
                <field name="user_id" select="1"/>
                <field name="obj_ret"  operator="+" />
                <field name="obj_num"  operator="+" />
                <field name="obj_margin"  operator="+" />
                <field name="net_revenue" operator="+" />
                <field name="gross_revenue" operator="+" />
            </graph>
        </field>
    </record>

    <record model="ir.actions.act_window" id="action_report_object_encoded_tree">
        <field name="name">Object statistics</field>
        <field name="res_model">report.object.encoded</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,graph</field>
        <field name="domain">[('date','ilike',time.strftime('%Y-%m'))]</field>
    </record>

    </data>
</openerp>