<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        
        <!-- Balance by account type -->
        
        <record id="view_crm_case_user_graph" model="ir.ui.view">
            <field name="name">report.account.receivable.graph</field>
            <field name="model">report.account.receivable</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph string="Accounts by type" type="bar">
                    <field name="name"/>
                    <field name="balance" operator="+"/>
                </graph>
            </field>
        </record>
        <record id="view_crm_case_user_tree" model="ir.ui.view">
            <field name="name">report.account.receivable.tree</field>
            <field name="model">report.account.receivable</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Accounts by type">
                    <field name="name"/>
                    <field name="type"/>
                    <field name="balance"/>
                    <field name="debit"/>
                    <field name="credit"/>
                </tree>
            </field>
        </record>
        <record id="view_crm_case_user_form" model="ir.ui.view">
            <field name="name">report.account.receivable.form</field>
            <field name="model">report.account.receivable</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Accounts by type">
                    <field name="name" select="1"/>
                    <field name="type" select="1"/>
                </form>
            </field>
        </record>
        
        <record id="action_account_receivable_graph" model="ir.actions.act_window">
            <field name="name">Balance by Type of Account</field>
            <field name="res_model">report.account.receivable</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,graph</field>
        </record>
        <menuitem action="action_account_receivable_graph" id="menu_account_receivable_graph" parent="account.menu_finance_reporting"/>
        
        <!-- Report for Aged Receivable -->
        
        <record id="view_aged_recv_graph" model="ir.ui.view">
            <field name="name">report.aged.receivable.graph</field>
            <field name="model">report.aged.receivable</field>
            <field name="type">graph</field>
            <field name="arch" type="xml">
                <graph string="Aged Receivable" type="bar">
                    <field name="name"/>
                    <field name="balance" operator="+"/>
                </graph>
            </field>
        </record>
        
        <record id="view_aged_recv_tree" model="ir.ui.view">
            <field name="name">report.aged.receivable.tree</field>
            <field name="model">report.aged.receivable</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Aged Receivable">
                    <field name="name" select="1"/>
                    <field name="balance" select="2"/>
                </tree>
            </field>
        </record>
        
        <record id="action_aged_receivable_graph" model="ir.actions.act_window">
            <field name="name">Aged Receivable</field>
            <field name="res_model">report.aged.receivable</field>
            <field name="view_type">form</field>
            <field name="view_mode">graph,tree</field>
        </record>
        
        <!-- Created Invoice for random activities of service dashboard -->
        
        <record id="board_view_created_invoice" model="ir.ui.view">
            <field name="name">report.invoice.created.tree</field>
            <field name="model">report.invoice.created</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree colors="blue:state=='draft'" string="Invoices">
                	<field name="create_date" select="1"/>
                    <field name="name" select="1"/>
                    <field name="type"/>
                    <field name="number"/>
                    <field name="partner_id"/>
                    <field name="amount_untaxed" sum="Untaxed Amount"/>
                    <field name="amount_total" sum="Total Amount"/>
                    <field name="currency_id"/>
                    <field name="date_invoice"/>
                    <field name="date_due" select="1"/>
                    <field name="residual"/>
                    <field name="state" select="2"/>
                    <field name="origin"/>
                </tree>
            </field>
        </record>
        
	    <record id="action_view_created_invoice_dashboard" model="ir.actions.act_window">
		    <field name="name">Invoices Created Within Past 15 Days</field>
		    <field name="res_model">report.invoice.created</field>
		    <field name="view_type">form</field>
		    <field name="view_mode">tree,form</field>
		    <field name="view_id" ref="board_view_created_invoice"/>
	    </record>
    </data>
</openerp>
