<?xml version="1.0"?>
<openerp>
 <data>
    <record model="ir.ui.view" id="view_document_user_form">
            <field name="name">report.document.user.form</field>
            <field name="model">report.document.user</field>
            <field name="arch" type="xml">
                <form string="Files">
                    <field name="name"/>
                    <field name="user"/>
                    <field name="directory"/>
                    <field name="datas_fname"/>
                    <field name="file_size"/>
                    <field name="create_date"/>
                </form>
            </field>
        </record>


        <record model="ir.ui.view" id="view_document_user_tree">
            <field name="name">report.document.user.tree</field>
            <field name="model">report.document.user</field>
            <field name="arch" type="xml">
                <tree string="Files">
                    <field name="name"/>
                    <field name="month"/>
                    <field name="user" invisible="1"/>
                    <field name="directory" invisible="1"/>
                    <field name="file_size" invisible="1"/>
                    <field name="create_date" invisible="1"/>
                    <field name="nbr"/>
                </tree>
            </field>
        </record>

        <record id="view_report_document_user_search" model="ir.ui.view">
            <field name="name">report.document.user.search</field>
            <field name="model">report.document.user</field>
            <field name="arch" type="xml">
                <search string="All users files">
                    <field name="name" filter_domain="['|', '|',('name','ilike',self), ('user','ilike',self), ('directory','ilike',self)]" string="Users File"/>
                    <field name="month"/>
               </search>
            </field>
        </record>


        <record model="ir.actions.act_window" id="action_view_all_document_tree1">
            <field name="name">All Users files</field>
            <field name="res_model">report.document.user</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="context">{'group_by': ['name','month']}</field>
            <field name="search_view_id" ref="view_report_document_user_search"/>
        </record>


        <record model="ir.ui.view" id="view_size_month">
            <field name="name">report.document.user.graph</field>
            <field name="model">report.document.file</field>
            <field name="arch" type="xml">
                <graph string="File Size by Month" type="line">
                    <field name="month"/>
                    <field name="file_size" operator="+"/>
                </graph>
            </field>
        </record>

        <record model="ir.ui.view" id="view_size_month_tree">
            <field name="name">report.document.user.tree</field>
            <field name="model">report.document.file</field>
            <field name="arch" type="xml">
                <tree string="File Size by Month">
                    <field name="month" />
                    <field name="file_size"/>
                </tree>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_view_size_month">
            <field name="name">File Size by Month</field>
            <field name="res_model">report.document.file</field>
            <field name="view_id" ref="view_size_month"></field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
        </record>


        <record model="ir.ui.view" id="view_files_by_month_graph">
            <field name="name">report.file.month.graph</field>
            <field name="model">report.document.user</field>
            <field name="arch" type="xml">
                <graph string="Files by Month" type="pie">
                    <field name="month" />
                    <field name="nbr" operator="+"/>
                </graph>
            </field>
        </record>

        <record model="ir.ui.view" id="view_files_by_month_tree">
            <field name="name">report.file.month.tree</field>
            <field name="model">report.document.user</field>
            <field name="arch" type="xml">
                <tree string="Files by Month">
                    <field name="name"/>
                    <field name="month"/>
                    <field name="nbr"/>
                </tree>
            </field>
        </record>

        <record model="ir.ui.view" id="view_files_by_user_graph">
            <field name="name">report.file.user.graph</field>
            <field name="model">report.document.user</field>
            <field name="arch" type="xml">
                <graph string="Files by User" type="pie">
                    <field name="user_id" />
                    <field name="nbr" operator="+"/>
                </graph>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_view_files_by_user_graph">
            <field name="name">Files by User</field>
            <field name="res_model">report.document.user</field>
            <field name="view_id" ref="view_files_by_user_graph"></field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
        </record>

        <record model="ir.actions.act_window" id="action_view_files_by_month_graph">
            <field name="name">Files by Month</field>
            <field name="res_model">report.document.user</field>
            <field name="view_id" ref="view_files_by_month_graph"></field>
            <field name="view_type">form</field>
            <field name="view_mode">tree</field>
        </record>

    </data>
</openerp>
