<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>
        <record model="ir.ui.view" id="crm_lead_forward_to_partner_form">
            <field name="name">crm_lead_forward_to_partner</field>
            <field name="model">crm.lead.forward.to.partner</field>
            <field name="arch" type="xml">
                <form string="Send Mail">
                    <group>
                        <field name="forward_type" widget="radio" invisible="context.get('hide_forward_type',False)"/>
                    </group>
                    <group>
                        <group>
                            <field name="partner_id" attrs="{'invisible': [('forward_type', 'in', ['assigned',False])], 'required': [('forward_type', '=', 'single')]}"  />
                        </group>
                        <group>
                        </group>
                    </group>
                    <field name="assignation_lines" attrs="{'invisible': [('forward_type', 'in', ['single',False])]}">
                        <tree create="false" editable="bottom">
                            <field name="lead_id" readonly="1" on_change="on_change_lead_id(lead_id)"/>
                            <field name="lead_location" readonly="1"/>
                            <field name="partner_assigned_id" on_change="on_change_partner_assigned_id(partner_assigned_id)"/>
                            <field name="partner_location" readonly="1"/>
                        </tree>
                    </field>
                    <notebook colspan="4" groups="base.group_no_one">
                        <page string="Email Template">
                            <field name="body" readonly="1"/>
                        </page>
                    </notebook>
                    <footer>
                        <button name="action_forward" string="Send" type="object" class="oe_highlight"/>
                        or
                        <button string="Cancel" special="cancel" class="oe_link"/>
                    </footer>
                </form>
            </field>
        </record>

        <record model="ir.actions.act_window" id="crm_lead_forward_to_partner_act">
            <field name="name">Forward to Partner</field>
            <field name="res_model">crm.lead.forward.to.partner</field>
            <field name="view_type">form</field>
            <field name="view_mode">form</field>
            <field name="view_id" ref="crm_lead_forward_to_partner_form"/>
            <field name="target">new</field>
        </record>

        <act_window id="action_crm_send_mass_forward" multi="True"
            key2="client_action_multi" name="Forward to Partner" res_model="crm.lead.forward.to.partner"
            src_model="crm.lead" view_mode="form" target="new" view_type="form"
            groups="base.group_sale_manager"
            context="{'default_composition_mode' : 'mass_mail'}" view_id="crm_lead_forward_to_partner_form" />

    </data>
</openerp>
