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

        <!-- Merge Opportunities  -->
        <record model="ir.ui.view" id="merge_opportunity_form">
            <field name="name">crm.merge.opportunity.form</field>
            <field name="model">crm.merge.opportunity</field>
            <field name="arch" type="xml">
                <form string="Merge Leads/Opportunities" version="7.0">
                    <separator string="Select Leads/Opportunities"/>
                    <field name="opportunity_ids">
                        <tree>
                            <field name="create_date"/>
                            <field name="name"/>
                            <field name="type"/>
                            <field name="contact_name"/>
                            <field name="email_from"/>
                            <field name="phone"/>
                            <field name="stage_id"/>
                            <field name="user_id"/>
                            <field name="section_id"/>
                        </tree>
                    </field>
                    <footer>
                        <button name="action_merge" type="object" string="Merge" class="oe_highlight"/>
                        or
                        <button string="Cancel" class="oe_link" special="cancel"/>
                    </footer>
                </form>
            </field>
        </record>

        <!--  Merge leads/opportunities action -->
        <record model="ir.actions.act_window" id="merge_opportunity_act">
            <field name="name">Merge leads/opportunities</field>
            <field name="res_model">crm.merge.opportunity</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="merge_opportunity_form"/>
            <field name="target">new</field>
        </record>

        <act_window id="action_merge_opportunities"
            multi="True"
            key2="client_action_multi" name="Merge leads/opportunities"
            res_model="crm.merge.opportunity" src_model="crm.lead"
            view_mode="form" target="new" view_type="form"/>

    </data>
</openerp>
