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

    <record model="ir.ui.view" id="base.view_model_fields_tree">
        <field name="name">ir.model.fields.tree</field>
        <field name="model">ir.model.fields</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Fields">
                <field name="model_id"/>
                <field name="name"/>
                <field name="field_description"/>
            </tree>
        </field>
    </record>
    
    <record model="ir.ui.view" id="base_report_creator_tree">
        <field name="name">base_report_creator.report.tree</field>
        <field name="model">base_report_creator.report</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Report Creator">
                <field name="name"/>
                <field name="type"/>
                <field name="state"/>
            </tree>
        </field>
    </record>
    <record model="ir.ui.view" id="base_report_creator_form">
        <field name="name">base_report_creator.report.form</field>
        <field name="model">base_report_creator.report</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Report Creator">
                <field name="name" select="1" colspan="4"/>
                <field name="type" select="2"/>
                <field name="active" select="2"/>
                <notebook colspan="4">
                <page string="General Configuration">
                    <field name="model_ids" colspan="4" context="{'model_ids':model_ids}"/>
                    <separator string="State"  colspan="4"/>
                    <field name="state"/>
                    <button string="Create Menu" name="%(wizard_menu_create)d" type="action" colspan="2"/>
                </page><page string="View parameters">
                    <separator string="Used View" colspan="4"/>
                    <field name="view_type1"/>
                    <field name="view_type2"/>
                    <field name="view_type3"/>
                    <separator string="Graph View" colspan="4"/>
                    <field name="view_graph_type"/>
                    <field name="view_graph_orientation"/>
                </page><page string="Fields to Display">
                    <field name="field_ids" nolabel="1" colspan="4">
                        <form string="Fields">
                            <field name="sequence"/>
                            <field name="field_id" domain="parent.model_ids and [('model_id','in',parent.model_ids[0][2]),('ttype','&lt;&gt;','many2many'),('ttype','&lt;&gt;','one2many')] or []">
                                <tree string="Field List">
                                    <field name="model_id"/>
                                    <field name="name"/>
                                    <field name="field_description"/>
                                </tree>
                            </field>
                            <field name="group_method"/>
                            <field name="graph_mode"/>
                            <field name="calendar_mode"/>
                        </form>
                        <tree editable="bottom" string="Fields to Display">
                            <field name="sequence"/>
                            <field name="field_id" domain="parent.model_ids and [('model_id','in',parent.model_ids[0][2]),('ttype','&lt;&gt;','many2many'),('ttype','&lt;&gt;','one2many')] or []" attrs="{'required':[('group_method','!=','count')]}"/>
                            <field name="group_method"/>
                            <field name="graph_mode"/>
                            <field name="calendar_mode"/>
                        </tree>
                    </field>
                </page><page string="Filters on Fields">
                    <button string="Add filter" name="%(wizard_set_filter_fields)d" type="action"/>
                    <field name="filter_ids" nolabel="1" colspan="4">
                        <tree string="Filters">
                            <field name="name"/>
                            <field name="condition"/>
                        </tree>
                        <form string="Filters">
                            <field name="name" colspan="4"/>
                            <field name="expression" colspan="4"/>
                            <field name="condition"/>
                        </form>
                    </field>
                    <separator string="Legend" colspan="4"/>
					<label string="Use %%(uid)s to filter by the connected user" align="0.0"/>
                </page><page string="Security">
                    <separator string="Authorized Groups (empty for all)" colspan="4"/>
                    <field name="group_ids" colspan="4" nolabel="1"/>
                </page><page string="SQL Query">
                    <field name="sql_query" colspan="4" nolabel="1"/>
                </page>
                </notebook>
            </form>
        </field>
    </record>
    <record model="ir.actions.act_window" id="base_report_creator_action">
    	<field name="name">Custom Report</field>
        <field name="res_model">base_report_creator.report</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,form</field>
    </record>
    <menuitem 
        name="Custom Reports" parent="board.next_id_50"
        id="menu_base_report_creator_action_config" 
        action="base_report_creator_action"/>

    <record model="ir.ui.view" id="base_report_creator_tree_simple">
        <field name="name">base_report_creator.report.simple.tree</field>
        <field name="model">base_report_creator.report</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Reports">
                <field name="name"/>
            </tree>
        </field>
    </record>
    <record model="ir.actions.act_window" id="base_report_creator_action_tree">
        <field name="res_model">base_report_creator.report</field>
        <field name="view_type">tree</field>
    </record>
    <menuitem 
        name="Custom Reports" parent="board.dashboard_menu"
        id="menu_base_report_creator_action" 
        action="base_report_creator_action_tree"/>

    <wizard
        id="wizard_report_open"
        string="Open Report"
        name="base_report_creator.report.open"/>

    <record model="ir.values" id="ir_open_report">
        <field name="key2" eval="'tree_but_open'"/>
        <field name="model" eval="'base_report_creator.report'"/>
        <field name="name">Browse Report</field>
        <field name="value" eval="'ir.actions.wizard,%d'%wizard_report_open"/>
        <field name="object" eval="True"/>
    </record>
    <record model="ir.values" id="ir_open_report_multi">
        <field name="key2" eval="'client_action_multi'"/>
        <field name="model" eval="'base_report_creator.report'"/>
        <field name="name">Browse Report</field>
        <field name="value" eval="'ir.actions.wizard,%d'%wizard_report_open"/>
        <field name="object" eval="True"/>
    </record>



    </data>
</openerp>
