summaryrefslogtreecommitdiff
path: root/addons/event_crm/views/event_lead_rule_views.xml
blob: fb15ea6a7e390083d09834e8c98b2e46f3078c66 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
    <record id="event_lead_rule_view_search" model="ir.ui.view">
        <field name="name">event.lead.rule.view.search</field>
        <field name="model">event.lead.rule</field>
        <field name="arch" type="xml">
            <search string="Search Lead Generation Rules">
                <field name="name" string="Name"/>
                <separator/>
                <filter string="Archived" name="filter_inactive" domain="[('active', '=', False)]"/>
                <filter string="Creation Type" name="filter_lead_creation_basis" context="{'group_by': 'lead_creation_basis'}"/>
                <filter string="Trigger Type" name="filter_lead_creation_trigger" context="{'group_by': 'lead_creation_trigger'}"/>
            </search>
        </field>
    </record>

    <record id="event_lead_rule_view_tree" model="ir.ui.view">
        <field name="name">event.lead.rule.view.tree</field>
        <field name="model">event.lead.rule</field>
        <field name="arch" type="xml">
            <tree string="Lead Generation Rules">
                <field name="name"/>
                <field name="lead_creation_basis" string="Lead Creation Type" invisible="1"/>
                <field name="lead_creation_trigger"/>
                <field name="event_type_ids" widget="many2many_tags"/>
                <field name="event_id"/>
                <field name="company_id" groups="base.group_multi_company"/>
            </tree>
        </field>
    </record>

    <record id="event_lead_rule_view_form" model="ir.ui.view">
        <field name="name">event.lead.rule.view.form</field>
        <field name="model">event.lead.rule</field>
        <field name="arch" type="xml">
            <form string="Lead Generation Rule">
                <sheet>
                    <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
                    <div class="oe_title">
                        <label for="name" class="oe_edit_only"/>
                        <h1><field name="name" placeholder="e.g. B2B Fairs"/></h1>
                    </div>
                    <field name="active" invisible="1"/>
                    <group name="lead_creation_configuration">
                        <group name="lead_creation_basis" invisible="1">
                            <field name="lead_creation_basis" widget="radio"/>
                        </group>
                        <group>
                            <field name="lead_creation_trigger" widget="radio"/>
                        </group>
                    </group>
                    <group string="For any of these Events">
                        <group>
                            <field name="event_type_ids" widget="many2many_tags"/>
                            <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
                        </group>
                        <group>
                            <field name="event_id" options="{'no_create': True}"/>
                        </group>
                    </group>
                    <group string="If the Attendees meet these Conditions">
                        <field name="event_registration_filter" widget="domain" options="{'model': 'event.registration'}" nolabel="1"/>
                    </group>
                    <group string="Lead Default Values">
                        <group class="col">
                            <field name="lead_type" groups="crm.group_use_lead"/>
                            <field name="lead_sales_team_id"/>
                            <field name="lead_user_id"/>
                        </group>
                        <group class="col">
                            <field name="lead_tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/>
                        </group>                         
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <record id="event_lead_rule_action" model="ir.actions.act_window">
        <field name="name">Lead Generation Rule</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">event.lead.rule</field>
        <field name="view_mode">tree,form</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">Create a Lead Generation Rule</p>
            <p>Those automatically create leads when attendees register.</p>
        </field>
    </record>

    <menuitem name="Lead Generation"
        id="event_lead_rule_menu" 
        action="event_lead_rule_action"
        parent="event.menu_event_configuration"
        sequence="10"
        groups="event.group_event_manager"/>
</data>
</odoo>