<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
    <record id="view_account_entries_report_tree" model="ir.ui.view">
        <field name="name">account.entries.report.tree</field>
        <field name="model">account.entries.report</field>
        <field name="arch" type="xml">
            <tree colors="blue:move_state == 'draft';black:move_state == 'posted'" create="false" string="Entries Analysis">
                <field name="date" invisible="1"/>
                <field name="date_created" invisible="1"/>
                <field name="date_maturity" invisible="1"/>
                <field name="ref" invisible="1"/>
                <field name="nbr" sum="# of Entries "/>
                <field name="quantity" sum="# of Products Qty " invisible="not context.get('quantity_visible', False)"/>
                <field name="amount_currency" invisible="not context.get('amount_currency_visible', False)"/>
                <field name="currency_id" invisible="not context.get('currency_id_visible', False)"/>
                <field name="debit"/>
                <field name="credit"/>
                <field name="balance"/>
                <field name="move_state" invisible="1"/>
                <field name="partner_id" invisible="1"/>
                <field name="product_id" invisible="1"/>
                <field name="product_uom_id" invisible="1"/>
                <field name="company_id" invisible="1" groups="base.group_multi_company"/>
                <field name="journal_id" invisible="1"/>
                <field name="account_id" invisible="1"/>
                <field name="fiscalyear_id" invisible="1"/>
                <field name="period_id" invisible="1"/>
                <field name="user_type" invisible="1"/>
                <field name="type" invisible="1"/>
           </tree>
        </field>
    </record>
    <record id="view_account_entries_report_graph" model="ir.ui.view">
         <field name="name">account.entries.report.graph</field>
         <field name="model">account.entries.report</field>
         <field name="arch" type="xml">
             <graph string="Entries Analysis" type="pivot">
                <field name="user_type" type="row"/>
                <field name="period_id" type="col"/>
                <field name="debit" type="measure"/>
                <field name="credit" type="measure"/>
                <field name="balance" type="measure"/>
             </graph>
         </field>
    </record>
    <record id="view_company_analysis_tree" model="ir.ui.view">
         <field name="name">account.company.analysis.tree</field>
         <field name="model">account.entries.report</field>
         <field name="arch" type="xml">
             <tree string="Company Analysis" >
                <field name="user_type"/>
                <field name="debit" />
                <field name="credit" />
                <field name="balance" />
             </tree>
         </field>
    </record>
    <record id="view_account_entries_report_search" model="ir.ui.view">
        <field name="name">account.entries.report.search</field>
        <field name="model">account.entries.report</field>
        <field name="arch" type="xml">
            <search string="Entries Analysis">
                <field name="date"/>
                <field name="date_created"/>
                <field name="date_maturity"/>
                <filter string="This F.Year" name="thisyear" domain="['|', ('date', '=', False), '&amp;',('date','&lt;=', time.strftime('%%Y-12-31')),('date','&gt;=',time.strftime('%%Y-01-01'))]" help="Journal Entries with period in current year"/>
                <filter string="This Period" name="period" context="{'period':'current_period'}" help="Journal Entries with period in current period"/>
                <separator/>
                <filter string="Unposted" domain="[('move_state','=','draft')]" help = "entries"/>
                <filter string="Posted" domain="[('move_state','=','posted')]" help = "Posted entries"/>
                <separator/>
                <filter string="Unreconciled" domain="[('reconcile_id','=',False), ('account_id.reconcile','=',True)]" help = "Unreconciled entries"/>
                <filter string="Reconciled" domain="[('reconcile_id','!=',False)]" help = "Reconciled entries"/>
                <field name="account_id"/>
                <field name="journal_id"/>
                <field name="period_id"/>
                <group expand="0" string="Extended Filters...">
                    <field name="fiscalyear_id"/>
                    <field name="product_id"/>
                    <field name="partner_id"/>
                    <field name="company_id" groups="base.group_multi_company"/>
                </group>
                <group expand="1" string="Group By">
                    <filter string="Partner" context="{'group_by':'partner_id'}"/>
                    <filter string="Journal" name="group_journal" context="{'group_by':'journal_id'}"/>
                    <filter string="Acc.Type" context="{'group_by':'user_type'}" name="usertype"/>
                    <filter string="Int.Type" context="{'group_by':'type'}"/>
                    <filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
                    <separator/>
                    <filter string="Entries Month" context="{'group_by':'date:month'}" help="Entries Date by Month"/>
                 </group>
            </search>
        </field>
    </record>
    <record id="action_account_entries_report_all" model="ir.actions.act_window">
        <field name="name">Entries Analysis</field>
        <field name="res_model">account.entries.report</field>
        <field name="view_type">form</field>
        <field name="view_mode">graph</field>
        <field name="search_view_id" ref="view_account_entries_report_search"/>
        <field name="view_id" ref="view_account_entries_report_graph"/>
        <field name="context">{'group_by':[], 'search_default_usertype':1, 'search_default_thisyear':1, 'group_by_no_leaf':1}</field>
        <field name="help">From this view, have an analysis of your different financial accounts. The document shows your debit and credit taking in consideration some criteria you can choose by using the search tool.</field>
    </record>
    <menuitem action="action_account_entries_report_all" id="menu_action_account_entries_report_all"
        parent="account.menu_finance_reporting"
        groups="group_account_manager"
        sequence="2"/>
</data>
</openerp>
