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

    <act_window
        id="crm_case_categ_meet_create_partner"
        name="Schedule a Meeting"
        res_model="crm.meeting"
        src_model="res.partner"
        view_mode="calendar,tree,form,gantt"
        context="{'search_default_partner_id': active_id, 'default_duration': 4.0}"
        domain="[('partner_id', '=', active_id)]"
    />

    <record model="ir.actions.act_window" id="crm_case_categ_meet_create_partner">
        <field name="name">Schedule a Meeting</field>
        <field name="context" eval="{'default_state':'draft'}"/>
    </record>


    <record model="ir.actions.act_window.view" id="action_crm_tag_calendar_meet_partner">
        <field name="sequence" eval="1"/>
        <field name="view_mode">calendar</field>
        <field name="view_id" ref="crm_case_calendar_view_meet"/>
        <field name="act_window_id" ref="crm_case_categ_meet_create_partner"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_tree_meet_partner">
        <field name="sequence" eval="2"/>
        <field name="view_mode">tree</field>
        <field name="view_id" ref="crm_case_tree_view_meet"/>
        <field name="act_window_id" ref="crm_case_categ_meet_create_partner"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_form_meet_partner">
        <field name="sequence" eval="3"/>
        <field name="view_mode">form</field>
        <field name="view_id" ref="crm_case_form_view_meet"/>
        <field name="act_window_id" ref="crm_case_categ_meet_create_partner"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_gantt_meet_partner">
        <field name="sequence" eval="3"/>
        <field name="view_mode">gantt</field>
        <field name="view_id" ref="crm_case_gantt_view_meet"/>
        <field name="act_window_id" ref="crm_case_categ_meet_create_partner"/>
    </record>

    <record model="ir.actions.act_window" id="crm_case_categ_meet">
        <field name="name">Meetings</field>
        <field name="res_model">crm.meeting</field>
        <field name="view_mode">calendar,tree,form,gantt</field>
        <field name="view_id" ref="crm_case_calendar_view_meet"/>
        <field name="context">{"search_default_user_id":uid, 'search_default_section_id': section_id, 'virtual_id' : True}</field>
        <field name="search_view_id" ref="view_crm_case_meetings_filter"/>
        <field name="help">The meeting calendar is shared between the sales teams and fully integrated with other applications such as the employee holidays or the business opportunities. You can also synchronize meetings with your mobile phone using the caldav interface.
        </field>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_calendar_meet">
        <field name="sequence" eval="1"/>
        <field name="view_mode">calendar</field>
        <field name="view_id" ref="crm_case_calendar_view_meet"/>
        <field name="act_window_id" ref="crm_case_categ_meet"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_tree_meet">
        <field name="sequence" eval="2"/>
        <field name="view_mode">tree</field>
        <field name="view_id" ref="crm_case_tree_view_meet"/>
        <field name="act_window_id" ref="crm_case_categ_meet"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_form__meet">
        <field name="sequence" eval="3"/>
        <field name="view_mode">form</field>
        <field name="view_id" ref="crm_case_form_view_meet"/>
        <field name="act_window_id" ref="crm_case_categ_meet"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_gantt_meet">
        <field name="sequence" eval="1"/>
        <field name="view_mode">gantt</field>
        <field name="view_id" ref="crm_case_gantt_view_meet"/>
        <field name="act_window_id" ref="crm_case_categ_meet"/>
    </record>

<!-- ALL MEETINGS -->

    <menuitem name="Meetings" id="menu_meeting_sale"
        parent="base.menu_base_partner" sequence="3"/>

    <menuitem name="Meetings" id="menu_crm_case_categ_meet"
        action="crm_case_categ_meet" parent="menu_meeting_sale"
        sequence="1" />

    <record id="action_view_attendee_form" model="ir.actions.act_window">
         <field name="name">Meeting Invitations</field>
         <field name="type">ir.actions.act_window</field>
         <field name="res_model">calendar.attendee</field>
         <field name="view_type">form</field>
         <field name="view_mode">tree,form</field>
         <field name="view_id" ref="base_calendar.base_calendar_attendee_tree_view" />
        <field name="domain">[('ref','like','crm.meeting,')]</field>
         <field name="context">{"search_default_toreview":1, "search_default_user_id":uid}</field>
        <field name="help">With Meeting Invitations you can create and manage the meeting invitations sent/to be sent to your colleagues/partners. You can not only invite OpenERP users, but also external parties, such as a customer.</field>
     </record>

    <menuitem id="menu_attendee_invitations"
            name="Meeting Invitations" parent="crm.menu_meeting_sale"
            sequence="10" action="action_view_attendee_form"
            groups="base.group_no_one" />

</data>
</openerp>
