<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <menuitem id="base.reporting_menu"
            parent="base.menu_custom"
            name="Reporting" sequence="30" />
<!--Board Note Search View  -->
        <record id="view_board_note_search" model="ir.ui.view">
            <field name="name">board.note.search</field>
            <field name="model">board.note</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Notes">
                    <group col="10" colspan="4">
                        <field name="name" string="Subject"/>
                        <field name="type" string="Note Type"/>
                        <field name="date" string="Date"/>
                    </group>
                    <newline/>
                    <group expand="0" colspan="4" string="Group By...">
                        <filter string="Author" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
                    </group>
                </search>
            </field>
        </record>
        
<!--Board Note Tree View  -->

        <record id="view_board_note_tree" model="ir.ui.view">
            <field name="name">board.note.tree</field>
            <field name="model">board.note</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Notes">
                    <field name="name"/>
                    <field name="user_id"/>                    
                </tree>
            </field>
        </record>
        
<!--Board Note Form View  -->

        <record id="view_board_note_form" model="ir.ui.view">
            <field name="name">board.note.form</field>
            <field name="model">board.note</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Note">
                    <field name="name" select="1"/>
                    <field name="type" select="1" required="1"/>
                    <field name="user_id" select="1"/>
                    <field name="date" select="1"/>
                    <separator string="Notes"  colspan="4"/>
                    <field colspan="4" name="note" nolabel="1"/>
                </form>
            </field>
        </record>

<!-- Action for Publish note Form -->

        <record id="action_view_board_note_form" model="ir.actions.act_window">
            <field name="name">Publish a note</field>
            <field name="res_model">board.note</field>
            <field name="view_type">form</field>
            <field name="view_mode">form,tree</field>
            <field name="search_view_id" ref="view_board_note_search"/>
        </record>

<!--  Board Tree View  -->

        <record id="view_board_tree" model="ir.ui.view">
            <field name="name">board.board.tree</field>
            <field name="model">board.board</field>
            <field name="type">tree</field>
            <field name="arch" type="xml">
                <tree string="Dashboard">
                    <field name="name"/>
                </tree>
            </field>
        </record>

<!-- Dashboard Definition Form View  -->

        <record id="view_board_form" model="ir.ui.view">
            <field name="name">board.board.form</field>
            <field name="model">board.board</field>
            <field name="type">form</field>
            <field eval="1" name="priority"/>
            <field name="arch" type="xml">
                <form string="Dashboard">
                    <field name="name"/>
                    <button colspan="2"
                        name="%(action_board_menu_create)d"
                        string="Create Menu" type="action"
                        icon="gtk-justify-fill" />
                    <field colspan="4" name="line_ids" nolabel="1">
                        <tree string="Dashboard View">
                            <field name="name"/>
                            <field name="sequence"/>
                            <field name="action_id"/>
                            <field name="position"/>
                        </tree>
                        <form string="Dashboard View">
                            <field name="name"/>
                            <field name="sequence"/>
                            <field name="width"/>
                            <field name="height"/>
                            <field name="action_id"
                                domain="[('view_type','!=','tree')]" />
                            <field name="position"/>
                        </form>
                    </field>
                </form>
            </field>
        </record>
        
        <record id="view_board_search" model="ir.ui.view">
            <field name="name">board.board.search</field>
            <field name="model">board.board</field>
            <field name="type">search</field>
            <field name="arch" type="xml">
                <search string="Dashboard">
                    <field name="name"/>
                    <field name="line_ids"/>
                </search>
            </field>
        </record>

    <!-- Action for DashBoard Definition form -->

        <record id="action_view_board_list_form" model="ir.actions.act_window">
            <field name="name">Dashboard Definition</field>
            <field name="res_model">board.board</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="search_view_id" ref="view_board_search"/>
        </record>

        <menuitem
            id="base.next_id_50"
            name="Configuration"
            parent="base.reporting_menu"
            groups="base.group_system"
            sequence="3"/>
        <menuitem
            action="action_view_board_list_form"
            id="menu_view_board_form"
            parent="base.next_id_50" sequence="1"/>

        <menuitem action="action_view_board_note_form"
            id="menu_view_board_note_form" parent="base.next_id_50"
            sequence="3" groups="base.group_system" />

        <act_window context="{'view': active_id}" id="dashboard_open"
            multi="True" name="Open Dashboard" res_model="board.board"
            src_model="board.board" />

    </data>
</openerp>
