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

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

    <record model="ir.actions.act_window" id="crm_case_categ_meet_create_partner">
        <field name="domain" eval="'[(\'section_id\',\'=\','+str(ref('section_support1'))+')]'"/>
    </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" id="crm_case_categ_meet">
        <field name="res_model">crm.case</field>
        <field name="view_mode">calendar,tree,form</field>
        <field name="view_id" ref="crm_case_calendar_view"/>
    </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>
    <menuitem parent="crm.menu_crm" name="Calendar" id="menu_crm_case_category_act_meetings"/>

    <!-- 
        MY MEETINGS 
    -->
    <record model="ir.actions.act_window" id="crm_case_categ_meetmy">
        <field name="res_model">crm.case</field>
        <field name="view_mode">calendar,tree,form,graph</field>
        <field name="view_id" ref="crm_case_calendar_view_meet"/>
        <field name="domain" eval="'[(\'user_id\',\'=\',uid)]'"/>
    </record>
    <record model="ir.actions.act_window.view" id="action_crm_tag_calendar_meet_my">
        <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_meetmy"/>
    </record>
    <record model="ir.actions.act_window.view" id="action_crm_tag_tree_meet_my">
        <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_meetmy"/>
    </record>
    <record model="ir.actions.act_window.view" id="action_crm_tag_form_meet_my">
        <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_meetmy"/>
    </record>
    <menuitem name="My Meetings" id="menu_crm_case_categ_meet_my" action="crm_case_categ_meetmy" parent="menu_crm_case_category_act_meetings"/>

    <record model="ir.actions.act_window" id="crm_case_category_act_meetings">
        <field name="name">New Meeting</field>
        <field name="res_model">crm.case</field>
        <field name="view_type">form</field>
        <field name="view_mode">form,tree</field>
        <field name="context" eval="{'default_section_id':ref('section_support1')}"/>
        <field name="view_id" ref="crm_case_form_view_meet"/>
    </record>
    <record model="ir.actions.act_window.view" id="action_crm_tag_form_view_meetings">
        <field name="sequence" eval="1"/>
        <field name="view_mode">form</field>
        <field name="view_id" ref="crm_case_form_view_meet"/>
        <field name="act_window_id" ref="crm_case_category_act_meetings"/>
    </record>
    <record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_meetings">
        <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_category_act_meetings"/>
    </record>
    <menuitem
        parent="menu_crm_case_category_act_meetings"
        id="menu_crm_case_category_act_meetings_new"
        action="crm_case_category_act_meetings" sequence="50"/>


    <!-- 
        ALL MEETINGS 
    -->
    <menuitem name="All Meetings" id="menu_crm_case_categ_meet" action="crm_case_categ_meet" parent="menu_crm_case_category_act_meetings"/>

    <record model="ir.actions.act_window" id="crm_case_category_act_meetall3">
        <field name="name">Next Meetings</field>
        <field name="res_model">crm.case</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,calendar,form</field>
        <field name="view_id" ref="crm_case_calendar_view_meet"/>
        <field name="domain" eval="[('state','in',('pending','draft','open')),('date','>=',time.strftime('%Y-%m-%d'))]"/>
    </record>
    <record model="ir.actions.act_window.view" id="action_crm_tag_calendar_view_meetall3">
        <field name="sequence" eval="2"/>
        <field name="view_mode">calendar</field>
        <field name="view_id" ref="crm_case_calendar_view_meet"/>
        <field name="act_window_id" ref="crm_case_category_act_meetall3"/>
    </record>
    <record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_meetall3">
        <field name="sequence" eval="1"/>
        <field name="view_mode">tree</field>
        <field name="view_id" ref="crm_case_tree_view_meet"/>
        <field name="act_window_id" ref="crm_case_category_act_meetall3"/>
    </record>
    <record model="ir.actions.act_window.view" id="action_crm_tag_form_view_meetall3">
        <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_category_act_meetall3"/>
    </record>

</data>
</openerp>
