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

    <act_window
        id="crm_case_categ_phone_create_partner"
        name="Schedule a Call"
        res_model="crm.phonecall"
        src_model="res.partner"
        view_mode="calendar,tree,form"
        context="{'search_default_partner_id': [active_id], 'default_duration': 1.0, 'default_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, 'search_default_section_id': section_id}</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,base.group_sale_salesman"
        parent="base.menu_base_partner" sequence="4" />

    <record model="ir.actions.act_window" id="crm_case_categ_phone_incoming0">
        <field name="name">Logged 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_inbound_phone_tree_view"/>
        <field name="domain">[('state','=','done')]</field>
        <field name="context" eval="'{\'search_default_section_id\':section_id, \'default_state\':\'done\', \'search_default_today\':1}'"/>
        <field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
        <field name="help">This tool allows you to log your inbound calls on the fly. Each call you get will appear on the partner form to trace every contact you have with a partner. From the phone call form, you can trigger a request for another call, a meeting or an opportunity.</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_phone_form_view"/>
        <field name="act_window_id" ref="crm_case_categ_phone_incoming0"/>
    </record>

    <menuitem name="Logged Calls" 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">Scheduled 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="domain">[('state','!=','done')]</field>
        <field name="context" eval="'{\'search_default_section_id\':section_id, \'default_state\':\'open\', \'search_default_current\':1,\'search_default_today\':1}'"/>
        <field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
        <field name="help">Scheduled calls list all the calls to be done by your sales team. A salesman can record the information about the call in the form view. This information will be stored in the partner form to trace every contact you have with a customer. You can also import a .CSV file with a list of calls to be done by your sales team.</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="Scheduled Calls" id="menu_crm_case_phone_outbound"
        parent="crm.menu_crm_case_phone"
        action="crm_case_categ_phone_outgoing0" />

</data>
</openerp>
