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

    <act_window
        id="crm_case_categ_phone_create_partner"
        name="Schedule Phone Call"
        res_model="crm.phonecall"
        src_model="res.partner"
        view_mode="calendar,tree,form"
        context="{'default_partner_id': active_id, 'default_duration': 1.0}"
        domain="[('partner_id', '=', active_id)]"
        groups="base.group_extended"
        />

    <!-- TO CONFIRM: This is fine -->
    <!-- act_window
            id="act_crm_phonecall_crm_meeting_new"
            name="Meetings"
            res_model="crm.meeting"
            src_model="crm.phonecall"
            view_mode="tree,form,calendar,"
            context="{'default_duration': 4.0, 'default_phonecall_id': active_id}"
            domain="[('phonecall_id', '=', active_id)]"
            view_type="form"/-->

<!-- PHONE CALLS (menu)  -->

    <record model="ir.actions.act_window" id="crm_case_categ_phone0">
        <field name="name">Phone Calls</field>
        <field name="res_model">crm.phonecall</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,calendar</field>
        <field name="view_id" ref="crm_case_phone_tree_view"/>
        <field name="context">{"search_default_user_id":uid}</field>
        <field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_tree_phone0">
        <field name="sequence" eval="1"/>
        <field name="view_mode">tree</field>
        <field name="view_id" ref="crm_case_phone_tree_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone0"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_calendar_phone0">
        <field name="sequence" eval="2"/>
        <field name="view_mode">calendar</field>
        <field name="view_id" ref="crm_case_phone_calendar_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone0"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_form_phone0">
        <field name="sequence" eval="3"/>
        <field name="view_mode">form</field>
        <field name="view_id" ref="crm_case_phone_form_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone0"/>
    </record>

    <menuitem name="Phone Calls" id="menu_crm_case_phone"
        groups="base.group_extended"
        parent="base.menu_base_partner" sequence="4" />

    <record model="ir.actions.act_window" id="crm_case_categ_phone_incoming0">
        <field name="name">Inbound</field>
        <field name="res_model">crm.phonecall</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,calendar</field>
        <field name="view_id" ref="crm_case_phone_tree_view"/>
        <field name="domain" eval="'[(\'categ_id\',\'=\','+str(ref('categ_phone1'))+')]'"/>
        <field name="context" eval="'{\'set_editable\':True,\'default_state\':\'open\', \'search_default_current\':1,\'search_default_today\':1, \'default_categ_id\': ' + str(ref('categ_phone1')) +'}'"/>
        <field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
        <field name="help">Trace easily all your Inbound calls. The Inbound menu open a search view in editable mode, so you can easily modify or add a new call record. With the actions buttons convert a lead into an opportunity or plan a meeting.</field>

    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_tree_phone_incoming0">
        <field name="sequence" eval="1"/>
        <field name="view_mode">tree</field>
        <field name="view_id" ref="crm_case_inbound_phone_tree_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone_incoming0"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_calendar_phone_incoming0">
        <field name="sequence" eval="2"/>
        <field name="view_mode">calendar</field>
        <field name="view_id" ref="crm_case_phone_calendar_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone_incoming0"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_form_phone_incoming0">
        <field name="sequence" eval="3"/>
        <field name="view_mode">form</field>
        <field name="view_id" ref="crm_case_inbound_phone_form_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone_incoming0"/>
    </record>

    <menuitem name="Inbound" id="menu_crm_case_phone_inbound"
        parent="crm.menu_crm_case_phone"
        action="crm_case_categ_phone_incoming0" />

    <record model="ir.actions.act_window" id="crm_case_categ_phone_outgoing0">
        <field name="name">Outbound</field>
        <field name="res_model">crm.phonecall</field>
        <field name="view_type">form</field>
        <field name="view_mode">tree,calendar</field>
        <field name="view_id" ref="crm_case_phone_tree_view"/>
        <field name="domain" eval="'[(\'categ_id\',\'=\','+str(ref('categ_phone2'))+')]'"/>
        <field name="context" eval="'{\'default_state\':\'open\', \'search_default_current\':1, \'default_categ_id\': ' + str(ref('categ_phone2')) +'}'"/>
        <field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
        <field name="help">The Outbound menu open a search view in editable mode, so you can easily modify or plan a new call. Actions buttons allows you to to make you call status evolved for a better follow up of your planned calls. During calls, convert your lead into an opportunity, plan a meeting or canceled it.</field>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_tree_phone_outgoing0">
        <field name="sequence" eval="1"/>
        <field name="view_mode">tree</field>
        <field name="view_id" ref="crm_case_phone_tree_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone_outgoing0"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_calendar_phone_outgoing0">
        <field name="sequence" eval="2"/>
        <field name="view_mode">calendar</field>
        <field name="view_id" ref="crm_case_phone_calendar_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone_outgoing0"/>
    </record>

    <record model="ir.actions.act_window.view" id="action_crm_tag_form_phone_outgoing0">
        <field name="sequence" eval="3"/>
        <field name="view_mode">form</field>
        <field name="view_id" ref="crm_case_phone_form_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone_outgoing0"/>
    </record>

    <menuitem name="Outbound" id="menu_crm_case_phone_outbound"
        parent="crm.menu_crm_case_phone"
        action="crm_case_categ_phone_outgoing0" />

</data>
</openerp>
