7 # ------------------------------------------------------
9 # ------------------------------------------------------
10 <record id="crm_lead_stage_act" model="ir.actions.act_window">
11 <field name="name">Lead Stages</field>
12 <field name="res_model">crm.case.stage</field>
13 <field name="view_type">form</field>
14 <field name="view_id" ref="crm.crm_case_stage_tree"/>
15 <field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
16 <field name="context">{'object_id':'crm.lead'}</field>
18 <menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act" parent="crm.menu_crm_case_stage"/>
19 # ------------------------------------------------------
21 # ------------------------------------------------------
23 <record model="ir.ui.view" id="crm_case_form_view_leads">
24 <field name="name">CRM - Leads Form</field>
25 <field name="model">crm.lead</field>
26 <field name="type">form</field>
27 <field name="arch" type="xml">
28 <form string="Leads Form">
29 <group colspan="4" col="6">
30 <field name="partner_name" string="Lead Name" required="1"/>
31 <field name="name" string="Lead Subject"/>
32 <button string="Create Opportunity" name="%(wizard_crm_lead_opportunity_set)d" icon="gtk-index" type="action"/>
33 <field name="partner_name2" string="Contact Name"/>
34 <field name="email_from" string="Email"/>
35 <button string="Convert to Partner"
36 icon="terp-partner" name="%(wizard_crm_lead_partner_create)d"
37 type="action" attrs="{'invisible':[('partner_id','!=',False)]}"
40 <notebook colspan="4">
42 <separator colspan="4" string="Communication"/>
43 <field name="partner_id" string="Partner"
44 on_change="onchange_partner_id(partner_id)" />
45 <field name="partner_address_id"
47 on_change="onchange_partner_address_id(partner_address_id, email_from)" />
48 <field name="partner_phone"/>
49 <field name="partner_mobile"/>
50 <separator colspan="4" string="Status and Categorization"/>
51 <group colspan="4" col="6">
52 <field name="user_id" select="2"/>
53 <field name="stage_id" select="1" string="Status" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
54 <field name="categ_id" select="1"
55 on_change="onchange_categ_id(categ_id)"
56 string="Lead Source" widget="selection"
57 domain="[('object_id.model', '=', 'crm.opportunity')]" />
58 <field name="type_id" string="Campaign" select="1"/>
59 <field name="section_id" colspan="1" widget="selection"/>
60 <field name="priority" string="Priority"/>
61 <field name="date" string="Create Date"/>
63 <separator colspan="4" string="Details"/>
64 <field name="description" nolabel="1" colspan="4"/>
65 <separator colspan="4"/>
66 <group col="8" colspan="4">
67 <field name="state" select="2"/>
68 <button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-close"/>
69 <button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
70 <button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
71 <button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause"/>
72 <button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
73 <button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert"/>
76 <page string="Emails" groups="base.group_extended">
78 <field colspan="4" name="email_cc" string="CC"/>
80 <field name="history_line" colspan="4" nolabel="1" mode="form,tree">
81 <form string="Communication history">
82 <group col="7" colspan="4">
85 <field name="canal_id"/>
88 name="%(crm.action_view_crm_email_add_cc_wizard)d"
89 icon="gtk-add" type="action"/>
92 <field name="description" colspan="4" nolabel="1"/>
93 <button colspan="4" string="Reply to Last Email" name="%(crm.wizard_crm_send_mail)d" context="{'mail':'reply'}" icon="gtk-go-forward" type="action"/>
95 <tree string="Communication history">
96 <field name="description"/>
101 <button colspan="4" string="Send New Email"
102 name="%(crm.wizard_crm_new_send_mail)d"
103 context="{'mail':'new'}" icon="gtk-go-forward"
110 <record model="ir.ui.view" id="crm_case_tree_view_leads">
111 <field name="name">CRM - Leads Tree</field>
112 <field name="model">crm.lead</field>
113 <field name="type">tree</field>
114 <field name="arch" type="xml">
115 <tree string="Leads Tree" colors="red:state=='open';black:state in ('draft', 'pending');grey: state in ('cancel','done')">
116 <field name="partner_name" string="Lead Name"/>
117 <field name="stage_id" string="Status"/>
118 <field name="date" string="Create Date"/>
119 <field name="categ_id" string="Lead Source"/>
120 <field name="email_from" string="Email"/>
121 <field name="user_id"/>
122 <field name="state"/>
123 <button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
124 <button name="case_close" string="Done" states="open,draft,pending" type="object" icon="gtk-close"/>
125 <button name="case_escalate" string="Escalate" states="open,draft,pending" type="object" icon="gtk-go-up"/>
126 <button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
130 <record model="ir.ui.view" id="crm_case_calendar_view_leads">
131 <field name="name">CRM - Leads Calendar</field>
132 <field name="model">crm.lead</field>
133 <field name="type">calendar</field>
134 <field name="priority" eval="2"/>
135 <field name="arch" type="xml">
136 <calendar string="Meeting For Leads Generation" date_start="date" color="user_id" date_delay="duration">
138 <field name="partner_name"/>
139 <field name="partner_name2"/>
145 <record id="view_crm_case_leads_filter" model="ir.ui.view">
146 <field name="name">CRM - Leads Search</field>
147 <field name="model">crm.lead</field>
148 <field name="type">search</field>
149 <field name="arch" type="xml">
150 <search string="Search Leads">
152 <group col="3" colspan="1">
153 <filter icon="gtk-home" string=" Today "
155 domain="[('date::date','=',time.strftime('%%Y-%%m-%%d'))]"
156 help="Todays's Leads"
158 <filter icon="gtk-media-rewind" string=" 7 Days "
159 separator="1" help="Leads during last 7 days"
160 domain="[('date','<', time.strftime('%%Y-%%m-%%d')), ('date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
163 <separator orientation="vertical"/>
164 <group col="6" colspan="2">
165 <field name="name" select="1"/>
166 <field name="user_id" select="1" widget="selection">
167 <filter icon="terp-partner"
168 domain="[('user_id','=',uid)]" help="My Leads"
172 <field name="state" select="1">
173 <filter icon="gtk-new" domain="[('state','in',('draft', 'open'))]" help="Current Leads" default="1"/>
174 <filter icon="gtk-yes" domain="[('state','=','open')]" help="Open Leads"/>
176 <field name="section_id" select="1" default="context.get('section_id', False)" widget="selection" string="Section">
177 <filter icon="terp-crm"
178 domain="[('section_id','=',context.get('section_id',False))]"
185 <group expand="1" string="Group By..." colspan="4" col="20">
186 <filter string="Status" icon="terp-crm" domain="[]" context="{'group_by':'stage_id'}"/>
187 <filter string="Lead Source" icon="terp-crm" domain="[]" context="{'group_by':'categ_id'}"/>
188 <filter string="Responsible" icon="terp-crm" domain="[]" context="{'group_by':'user_id'}"/>
189 <filter string="Create Date" icon="terp-crm" domain="[]" context="{'group_by':'date'}"/>