<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

      <record id="action_application_tiles" model="ir.actions.client">
        <field name="name">Applications Tiles</field>
        <field name="tag">board.home.applications</field>
      </record>
      <record id="action_res_widgets_tweets" model="ir.actions.client">
        <field name="name">Tweets Widget</field>
        <field name="tag">board.home.widgets</field>
        <field name="params" eval="{'widget_id': ref('base.openerp_favorites_twitter_widget')}"/>
      </record>
      <record id="action_res_widgets_events" model="ir.actions.client">
        <field name="name">Events Widget</field>
        <field name="tag">board.home.widgets</field>
        <field name="params" eval="{'widget_id': ref('base.events_widget')}"/>
      </record>
      <record id="action_res_widgets_facebook" model="ir.actions.client">
        <field name="name">Facebook Widget</field>
        <field name="tag">board.home.widgets</field>
        <field name="params" eval="{'widget_id': ref('base.facebook_widget')}"/>
      </record>
      <record id="action_res_widgets_note" model="ir.actions.client">
        <field name="name">Note Widget</field>
        <field name="tag">board.home.widgets</field>
        <field name="params" eval="{'widget_id': ref('base.note_widget')}"/>
      </record>
      <record id="action_res_widgets_map" model="ir.actions.client">
        <field name="name">Google Maps Widget</field>
        <field name="tag">board.home.widgets</field>
        <field name="params" eval="{'widget_id': ref('base.google_maps_widget')}"/>
      </record>
      <record id="action_res_widgets_currency_converter" model="ir.actions.client">
        <field name="name">Currency Converter Widget</field>
        <field name="tag">board.home.widgets</field>
        <field name="params" eval="{'widget_id': ref('base.currency_converter_widget')}"/>
      </record>
      <record id="view_board_homepage" model="ir.ui.view">
        <field name="name">Homepage Board</field>
        <field name="model">board.board</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
          <form string="">
            <hpaned>
              <child1>
                <action name="%(action_application_tiles)d"/>
              </child1>
              <child2>
                <action name="%(action_res_widgets_tweets)d"/>
                <action name="%(action_res_widgets_events)d"/>
              </child2>
            </hpaned>
          </form>
        </field>
      </record>
      <record id="homepage_action" model="ir.actions.act_window">
        <field name="name">Home Page</field>
        <field name="res_model">board.board</field>
        <field name="view_type">form</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="view_board_homepage"/>
      </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">
                    <group col="6" colspan="4">
                        <field name="name"/>
                        <field name="view_id"/>
                        <button colspan="2"
                            name="%(action_board_menu_create)d"
                            string="Create Menu" type="action"
                            icon="gtk-justify-fill" />
                    </group>
                    <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
            action="action_view_board_list_form"
            id="menu_view_board_form" parent="base.reporting_menu" sequence="1"/>

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

    </data>
</openerp>
