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

    	<!-- Opportunity to Phonecall view -->

        <record model="ir.ui.view" id="opportunity2phonecall_view">
            <field name="name">crm.opportunity2phonecall.form</field>
            <field name="model">crm.opportunity2phonecall</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Schedule/Log a call">
                 	<separator string="Schedule/Log a call" colspan="4"/>
                    <field name="action"/>
                    <separator string="Call Details" colspan="4"/>
                    <field name="name"/>
                    <field name="date" string="Planned Date" attrs="{'invisible': [('action','=','log')]}"/>
                    <newline/>
                    <field name="partner_id" readonly="True"/>
                    <field name="user_id" />                    
                    <field name="section_id" widget="selection" />
                    <field name="categ_id" string="Type" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
                    <separator string="" colspan="4"/>
                    <group colspan="4" col="3">
                        <button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />
                       	<button name="action_apply" type="object" string="Log call" icon="gtk-ok" attrs="{'invisible' : [('action', '!=', 'log')]}" />
                        <button name="action_apply" type="object" string="Schedule call" icon="gtk-ok" attrs="{'invisible' : [('action', '!=', 'schedule')]}" />
                    </group>
                </form>
            </field>
        </record>

		<!-- Opportunity to Phonecall action -->

 		<record model="ir.actions.act_window" id="opportunity2phonecall_act">
            <field name="name">Schedule/Log Call</field>
            <field name="res_model">crm.opportunity2phonecall</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="opportunity2phonecall_view"/>
            <field name="target">new</field>
        </record>

    </data>
</openerp>
