5 <!-- Stage Search view -->
7 <record id="crm_lead_stage_search" model="ir.ui.view">
8 <field name="name">Stage - Search</field>
9 <field name="model">crm.case.stage</field>
10 <field name="type">search</field>
11 <field name="arch" type="xml">
12 <search string="Stage Search">
13 <filter icon="terp-personal" name="lead"
14 string="Lead" domain="[('type', '=', 'lead')]" context="{'type' : 'lead'}"/>
15 <filter icon="terp-personal+" name="opportunity"
16 string="Opportunity" domain="[('type', '=', 'opportunity')]" context="{'type' : 'opportunity'}"/>
22 <!--Lead Stage Form view -->
24 <record id="crm_lead_stage_act" model="ir.actions.act_window">
25 <field name="name">Stages</field>
26 <field name="res_model">crm.case.stage</field>
27 <field name="view_type">form</field>
28 <field name="view_id" ref="crm.crm_case_stage_tree"/>
29 <field name="context">{'search_default_opportunity':1}</field>
30 <field name="search_view_id" ref="crm_lead_stage_search"/>
31 <field name="help">Add specific stages to leads and opportunities allowing your sales to better organise their sales pipeline. Stages will allow them to easily track how a specific lead or opportunity is positioned in the sales cycle.</field>
34 <menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act" name="Stages"
35 groups="base.group_extended" sequence="0"
36 parent="base.menu_crm_config_lead" />
39 <!-- Lead/Opportunity Categories Action -->
41 <record id="crm_lead_categ_action" model="ir.actions.act_window">
42 <field name="name">Categories</field>
43 <field name="res_model">crm.case.categ</field>
44 <field name="view_type">form</field>
45 <field name="view_id" ref="crm_case_categ_tree-view"/>
46 <field name="context">{'object_id': 'crm.lead'}</field>
47 <field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
48 <field name="help">Create specific categories that fit your company's activities to better classify and analyse your leads and opportunities. Such categories could for instance reflect your product structure or the different types of sales you do.</field>
51 <menuitem action="crm_lead_categ_action"
52 id="menu_crm_lead_categ" name="Categories"
53 parent="base.menu_crm_config_lead" sequence="1"/>
56 <!-- CRM Lead Form View -->
57 <record model="ir.ui.view" id="crm_case_form_view_leads">
58 <field name="name">CRM - Leads Form</field>
59 <field name="model">crm.lead</field>
60 <field name="type">form</field>
61 <field name="arch" type="xml">
62 <form string="Leads Form">
63 <group colspan="4" col="7">
64 <field name="name" required="1" string="Subject"/>
65 <field name="priority"/>
66 <field name="categ_id"
68 domain="[('object_id.model','=','crm.lead')]"/>
70 name="convert_opportunity"
71 string="Convert to Opportunity"
72 help="Convert to Opportunity" icon="gtk-go-forward"
75 <field name="user_id" />
76 <field name="section_id" widget="selection" />
77 <field name="stage_id" domain="[('type','=','lead'),('section_ids', '=', section_id)]" />
78 <group col="2" colspan="1">
79 <button name="stage_previous" string=""
80 states="open,pending,draft" type="object"
81 icon="gtk-go-back" context="{'stage_type': 'lead'}" />
82 <button name="stage_next" string=""
83 states="open,pending,draft" type="object"
84 icon="gtk-go-forward" context="{'stage_type': 'lead'}" />
86 <field name="type" invisible="1"/>
88 <notebook colspan="4">
90 <group colspan="4" col="2">
91 <field name="partner_name" string="Partner Name" />
93 <group colspan="2" col="4">
94 <separator string="Contact" colspan="4" col="4"/>
95 <field name="contact_name" colspan="4"/>
97 <field domain="[('domain', '=', 'contact')]" name="title" widget="selection"/>
98 <field name="function" />
99 <field name="street" colspan="4"/>
100 <field name="street2" colspan="4"/>
103 <field name="country_id"/>
104 <field name="state_id"/>
106 <group colspan="2" col="3">
107 <separator string="Communication" colspan="4" col="3"/>
108 <field name="email_from" widget="email"/>
109 <button string="Mail"
110 name="%(mail.action_email_compose_message_wizard)d"
111 icon="terp-mail-message-new" type="action" colspan="1"/>
113 <field name="phone"/>
117 <field name="mobile"/>
119 <separator string="Links" colspan="4" col="3"/>
120 <field name="partner_id" string="Customer"/>
122 name="%(action_crm_lead2partner)d"
123 icon="terp-partner" type="action"
125 attrs="{'invisible':[('partner_id','!=',False)]}"/>
127 <separator colspan="4" string="Notes"/>
128 <field name="description" nolabel="1" colspan="4"/>
129 <separator colspan="4"/>
130 <group col="8" colspan="4">
131 <field name="state"/>
132 <button name="case_cancel" string="Cancel"
133 states="draft,open,pending" type="object"
135 <button name="case_open" string="Open"
136 states="draft,pending" type="object"
137 icon="gtk-go-forward" />
138 <button name="case_mark_lost" string="Close"
139 states="open,pending" type="object"
141 <button name="case_pending" string="Pending"
142 states="open" type="object"
143 icon="gtk-media-pause" />
144 <button name="case_escalate" string="Escalate"
145 states="open,pending" type="object"
146 groups="base.group_extended"
148 <button name="case_reset"
149 string="Reset to Draft" states="done,cancel"
150 type="object" icon="gtk-convert" />
153 <page string="Extra Info" groups="base.group_extended">
154 <group colspan="2" col="2">
155 <separator string="Categorization" colspan="2" col="2"/>
156 <field name="company_id"
157 groups="base.group_multi_company"
158 widget="selection" colspan="2" />
159 <field name="type_id" select="1" widget="selection"/>
160 <field name="channel_id" select="1" widget="selection"/>
161 <field name="referred"/>
163 <group colspan="2" col="2">
164 <separator string="Dates" colspan="2" col="2"/>
165 <field name="create_date"/>
166 <field name="write_date"/>
167 <field name="date_open"/>
168 <field name="date_closed"/>
170 <group colspan="2" col="2">
171 <separator string="Mailings" colspan="2" col="2"/>
172 <field name="optin" on_change="on_change_optin(optin)"/>
173 <field name="optout" on_change="on_change_optout(optout)"/>
175 <group colspan="2" col="2">
176 <separator string="Statistics" colspan="2" col="2"/>
177 <field name="day_open"/>
178 <field name="day_close"/>
181 <page string="Communication & History" groups="base.group_extended">
183 <field colspan="4" name="email_cc" widget="char" size="512"/>
185 <field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
186 <tree string="History">
187 <field name="display_text" string="History Information"/>
189 string="Reply" attrs="{'invisible': [('email_from', '=', False)]}"
190 name="%(mail.action_email_compose_message_wizard)d"
191 context="{'mail':'reply', 'message_id':active_id}"
192 icon="terp-mail-replied" type="action" />
194 <form string="History">
195 <group col="4" colspan="4">
196 <field name="email_from"/>
198 <field name="email_to" size="512"/>
199 <field name="email_cc" size="512"/>
200 <field name="subject" colspan="4" widget="char" attrs="{'invisible': [('email_from', '=', False)]}" size="512"/>
201 <field name="display_text" colspan="4" attrs="{'invisible': [('email_from', '!=', False)]}"/>
203 <notebook colspan="4">
204 <page string="Details">
205 <field name="body_text" colspan="4" nolabel="1"/>
206 <group attrs="{'invisible': [('email_from', '=', False)]}">
207 <button colspan="4" string="Reply"
208 name="%(mail.action_email_compose_message_wizard)d"
209 context="{'mail':'reply'}"
210 icon="terp-mail-replied" type="action"/>
214 <page string="Attachments">
215 <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
220 <button string="Add Internal Note"
221 name="%(crm.action_crm_add_note)d"
222 context="{'model': 'crm.lead' }"
223 icon="terp-document-new" type="action" />
224 <button string="Send New Email"
225 name="%(mail.action_email_compose_message_wizard)d"
226 icon="terp-mail-message-new" type="action"/>
233 <!-- CRM Lead Tree View -->
235 <record model="ir.ui.view" id="crm_case_tree_view_leads">
236 <field name="name">Leads</field>
237 <field name="model">crm.lead</field>
238 <field name="type">tree</field>
239 <field name="arch" type="xml">
240 <tree string="Leads" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
241 <field name="date_deadline" invisible="1"/>
242 <field name="create_date"/>
243 <field name="name" string="Subject"/>
244 <field name="contact_name"/>
245 <field name="country_id" invisible="context.get('invisible_country', True)" />
246 <field name="email_from"/>
247 <field name="phone"/>
249 <field name="categ_id" invisible="1"/>
250 <field name="type_id" invisible="1"/>
251 <field name="referred" invisible="1"/>
252 <field name="channel_id" invisible="1"/>
253 <field name="subjects" invisible="1"/>
255 <field name="stage_id"/>
256 <button name="stage_previous" string="Previous Stage"
257 states="open,pending" type="object" icon="gtk-go-back" />
258 <button name="stage_next" string="Next Stage"
259 states="open,pending" type="object"
260 icon="gtk-go-forward" />
261 <field name="section_id" invisible="context.get('invisible_section', True)" />
262 <field name="user_id" />
263 <field name="state" />
264 <button name="case_open" string="Open"
265 states="draft,pending" type="object"
266 icon="gtk-go-forward" />
267 <button name="case_close" string="Close"
268 states="open,draft,pending" type="object"
270 <button string="Convert to Opportunity"
271 name="convert_opportunity"
272 states="draft,open,pending" icon="gtk-go-forward"
274 <button name="case_escalate" string="Escalate"
275 states="open,draft,pending" type="object"
281 <!-- CRM Lead Calendar View -->
283 <record model="ir.ui.view" id="crm_case_calendar_view_leads">
284 <field name="name">CRM - Leads Calendar</field>
285 <field name="model">crm.lead</field>
286 <field name="type">calendar</field>
287 <field name="priority" eval="2"/>
288 <field name="arch" type="xml">
289 <calendar string="Leads Generation"
290 date_start="create_date" color="user_id">
291 <field name="name" />
292 <field name="partner_name" />
293 <field name="partner_address_id" />
298 <!-- CRM Lead Search View -->
300 <record id="view_crm_case_leads_filter" model="ir.ui.view">
301 <field name="name">CRM - Leads Search</field>
302 <field name="model">crm.lead</field>
303 <field name="type">search</field>
304 <field name="arch" type="xml">
305 <search string="Search Leads">
306 <filter icon="terp-check"
308 name="current" help="Draft, Open and Pending Leads"
309 domain="[('state','in',('draft','open','pending'))]"/>
310 <filter icon="terp-camera_test"
312 domain="[('state','=','open')]"/>
313 <filter icon="terp-gtk-media-pause"
315 domain="[('state','=','pending')]"/>
317 <separator orientation="vertical"/>
318 <filter icon="terp-go-today" string="Today"
319 domain="[('create_date','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]"
320 help="Todays' Leads" />
321 <filter icon="terp-go-week" string="7 Days"
322 help="Leads creating during last 7 days"
323 domain="[('create_date','<', time.strftime('%%Y-%%m-%%d 23:59:59')),('create_date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d 00:00:00'))]"
325 <separator orientation="vertical"/>
326 <field name="name" string="Lead / Customer"
327 domain="['|','|',('partner_name','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
328 <field name="user_id">
329 <filter icon="terp-personal-"
330 domain="[('user_id','=', False)]"
331 help="Unassigned Leads" />
333 <field name="subjects" groups="base.group_extended"/>
334 <field name="section_id" widget="selection"
335 context="{'invisible_section': False}">
336 <filter icon="terp-personal+" groups="base.group_extended"
337 context="{'invisible_section': False}"
338 domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
339 help="My Sales Team(s)"/>
340 <filter icon="terp-personal+" groups="base.group_extended"
341 context="{'invisible_section': False}"
343 help="Show Sales Team"/>
345 <separator orientation="vertical"/>
346 <field name="country_id" context="{'invisible_country': False}">
347 <filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
350 <group expand="0" string="Group By...">
351 <filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
352 <filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
353 <filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
354 <separator orientation="vertical"/>
355 <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}"/>
356 <filter string="Campaign" icon="terp-gtk-jump-to-rtl"
357 domain="[]" context="{'group_by':'type_id'}" />
358 <filter string="Channel" icon="terp-call-start"
359 domain="[]" context="{'group_by':'channel_id'}" />
360 <separator orientation="vertical"/>
361 <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
362 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
363 <separator orientation="vertical"/>
364 <filter string="Creation" help="Create date" icon="terp-go-month"
365 domain="[]" context="{'group_by':'create_date'}" />