summaryrefslogtreecommitdiff
path: root/addons/crm/wizard/crm_lead_to_opportunity_views.xml
blob: 2a379c1941162117efe78ffb1c97bc4a669adcec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?xml version="1.0"?>
<odoo>
    <record id="view_crm_lead2opportunity_partner" model="ir.ui.view">
        <field name="name">crm.lead2opportunity.partner.form</field>
        <field name="model">crm.lead2opportunity.partner</field>
        <field name="arch" type="xml">
            <form string="Convert to Opportunity">
                <group name="name">
                    <field name="name" widget="radio"/>
                </group>
                <group string="Assign this opportunity to">
                    <field name="user_id" domain="[('share', '=', False)]"/>
                    <field name="team_id" widget="selection"/>
                </group>
                <group string="Opportunities" attrs="{'invisible': [('name', '!=', 'merge')]}">
                    <field name="lead_id" invisible="1"/>
                    <field name="duplicated_lead_ids" nolabel="1">
                        <tree>
                            <field name="create_date" widget="date"/>
                            <field name="name"/>
                            <field name="type"/>
                            <field name="contact_name"/>
                            <field name="country_id" invisible="context.get('invisible_country', True)"/>
                            <field name="email_from"/>
                            <field name="stage_id"/>
                            <field name="user_id"/>
                            <field name="team_id" kanban_view_ref="%(sales_team.crm_team_view_kanban)s"/>
                        </tree>
                    </field>
                </group>
                <group name="action" attrs="{'invisible': [('name', '!=', 'convert')]}" string="Customer" col="1">
                    <field name="action" nolabel="1" widget="radio"/>
                    <group col="2">
                        <field name="partner_id" widget="res_partner_many2one" context="{'res_partner_search_mode': 'customer', 'show_vat': True}" attrs="{'required': [('action', '=', 'exist')], 'invisible':[('action','!=','exist')]}"/>
                    </group>
                </group>
                <footer>
                    <button name="action_apply" string="Create Opportunity" type="object" class="btn-primary"/>
                    <button string="Cancel" class="btn-secondary" special="cancel"/>
                </footer>
            </form>
        </field>
    </record>

    <record id="action_crm_lead2opportunity_partner" model="ir.actions.act_window">
        <field name="name">Convert to opportunity</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">crm.lead2opportunity.partner</field>
        <field name="view_mode">form</field>
        <field name="view_id" ref="view_crm_lead2opportunity_partner"/>
        <field name="target">new</field>
    </record>
</odoo>