5 <!--Lead Stage Form view -->
7 <record id="crm_lead_stage_act" model="ir.actions.act_window">
8 <field name="name">Stages</field>
9 <field name="res_model">crm.case.stage</field>
10 <field name="view_type">form</field>
11 <field name="view_id" ref="crm.crm_case_stage_tree"/>
12 <field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
13 <field name="context">{'object_id':'crm.lead'}</field>
14 <field name="help">Create specific stages that will help your sales better organise their sales pipeline by maintaining them to their leads and sales opportunities. It will allow them to easily track how is positioned a specific lead or opportunity in the sales cycle.</field>
17 <menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act" name="Stages"
18 groups="base.group_extended" sequence="0"
19 parent="base.menu_crm_config_lead" />
22 <!-- Lead/Opportunity Categories Action -->
24 <record id="crm_lead_categ_action" model="ir.actions.act_window">
25 <field name="name">Categories</field>
26 <field name="res_model">crm.case.categ</field>
27 <field name="view_type">form</field>
28 <field name="view_id" ref="crm_case_categ_tree-view"/>
29 <field name="context">{'object_id': 'crm.lead'}</field>
30 <field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
31 <field name="help">Create specific categories that fit your company's activities in order to better classify and analyse them after they have been maintained in your leads and opportunities. You can use categories to reflect your product structure or the different types of sales you do.</field>
34 <menuitem action="crm_lead_categ_action"
35 id="menu_crm_lead_categ" name="Categories"
36 parent="base.menu_crm_config_lead" sequence="1"/>
39 <!-- CRM Lead Form View -->
40 <record model="ir.ui.view" id="crm_case_form_view_leads">
41 <field name="name">CRM - Leads Form</field>
42 <field name="model">crm.lead</field>
43 <field name="type">form</field>
44 <field name="arch" type="xml">
45 <form string="Leads Form">
46 <group colspan="4" col="7">
47 <field name="name" required="1" string="Subject"/>
48 <field name="priority"/>
49 <field name="categ_id"
51 domain="[('object_id.model','=','crm.lead')]"/>
53 name="convert_opportunity"
54 string="Convert to Opportunity"
55 help="Convert to Opportunity" icon="gtk-go-forward"
58 <field name="section_id" widget="selection" />
59 <field name="user_id" />
60 <field name="stage_id" domain="[('object_id.model', '=', 'crm.lead'), ('section_ids', '=', section_id)]"/>
61 <group col="2" colspan="1">
62 <button name="stage_previous" string=""
63 states="open,pending,draft" type="object"
65 <button name="stage_next" string=""
66 states="open,pending,draft" type="object"
67 icon="gtk-go-forward" />
69 <field name="type" invisible="1"/>
71 <notebook colspan="4">
73 <group colspan="4" col="2">
74 <field name="partner_name" string="Partner Name" />
76 <group colspan="2" col="4">
77 <separator string="Contact" colspan="4" col="4"/>
78 <field name="contact_name" colspan="4"/>
80 <field domain="[('domain', '=', 'contact')]" name="title" widget="selection"/>
81 <field name="function" />
82 <field name="street" colspan="4"/>
83 <field name="street2" colspan="4"/>
86 <field name="country_id"/>
87 <field name="state_id"/>
89 <group colspan="2" col="3">
90 <separator string="Communication" colspan="4" col="3"/>
91 <field name="email_from" widget="email"/>
97 <field name="mobile"/>
99 <separator string="Links" colspan="4" col="3"/>
100 <field name="partner_id" on_change="onchange_partner_id(partner_id, email_from)" string="Customer"/>
102 name="%(action_crm_lead2partner)d"
103 icon="terp-partner" type="action"
105 attrs="{'invisible':[('partner_id','!=',False)]}"/>
107 <separator colspan="4" string="Notes"/>
108 <field name="description" nolabel="1" colspan="4"/>
109 <separator colspan="4"/>
110 <group col="8" colspan="4">
111 <field name="state"/>
112 <button name="case_cancel" string="Cancel"
113 states="draft,open,pending" type="object"
115 <button name="case_open" string="Open"
116 states="draft,pending" type="object"
117 icon="gtk-go-forward" />
118 <button name="case_mark_lost" string="Close"
119 states="open,pending" type="object"
121 <button name="case_pending" string="Pending"
122 states="open" type="object"
123 icon="gtk-media-pause" />
124 <button name="case_escalate" string="Escalate"
125 states="open,pending" type="object"
126 groups="base.group_extended"
128 <button name="case_reset"
129 string="Reset to Draft" states="done,cancel"
130 type="object" icon="gtk-convert" />
133 <page string="Extra Info" groups="base.group_extended">
134 <group colspan="2" col="2">
135 <separator string="Categorization" colspan="2" col="2"/>
136 <field name="company_id"
137 groups="base.group_multi_company"
138 widget="selection" colspan="2" />
139 <field name="type_id" select="1" widget="selection"/>
140 <field name="channel_id" select="1" widget="selection"/>
141 <field name="referred"/>
143 <group colspan="2" col="2">
144 <separator string="Dates" colspan="2" col="2"/>
145 <field name="create_date"/>
146 <field name="write_date"/>
147 <field name="date_open"/>
148 <field name="date_closed"/>
150 <group colspan="2" col="2">
151 <separator string="Mailings" colspan="2" col="2"/>
152 <field name="optin"/>
153 <field name="optout"/>
155 <group colspan="2" col="2">
156 <separator string="Statistics" colspan="2" col="2"/>
157 <field name="day_open"/>
158 <field name="day_close"/>
161 <page string="History" groups="base.group_extended">
163 <field colspan="4" name="email_cc" widget="char" size="512"/>
165 <field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
166 <tree string="Communication history">
167 <field name="display_text" string="History Information"/>
168 <field name="history" invisible="1"/>
170 string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
171 name="%(crm.action_crm_send_mail)d"
172 context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
173 icon="terp-mail-replied" type="action" />
175 <form string="Communication history">
176 <group col="4" colspan="4">
177 <field name="email_from"/>
179 <field name="email_to" widget="char" size="512"/>
180 <field name="email_cc" widget="char" size="512"/>
181 <field name="name" colspan="4" widget="char" size="512"/>
182 <field name="history" invisible="1"/>
184 <notebook colspan="4">
185 <page string="Details">
186 <group attrs="{'invisible': [('history', '!=', True)]}">
187 <field name="description" colspan="4" nolabel="1" height="250"/>
190 name="%(crm.action_crm_send_mail)d"
191 context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
192 icon="terp-mail-replied" type="action" />
194 <group attrs="{'invisible': [('history', '=', True)]}">
195 <field name="display_text" colspan="4" nolabel="1" height="250"/>
198 <page string="Attachments">
199 <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
204 <button string="Add Internal Note"
205 name="%(crm.action_crm_add_note)d"
206 context="{'model': 'crm.lead' }"
207 icon="terp-document-new" type="action" />
208 <button string="Send New Email"
209 name="%(crm.action_crm_send_mail)d"
210 context="{'mail':'new', 'model': 'crm.lead'}"
211 icon="terp-mail-message-new" type="action" />
218 <!-- CRM Lead Tree View -->
220 <record model="ir.ui.view" id="crm_case_tree_view_leads">
221 <field name="name">Leads</field>
222 <field name="model">crm.lead</field>
223 <field name="type">tree</field>
224 <field name="arch" type="xml">
225 <tree string="Leads" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
226 <field name="date_deadline" invisible="1"/>
227 <field name="create_date"/>
228 <field name="name" string="Subject"/>
229 <field name="contact_name"/>
230 <field name="country_id" invisible="context.get('invisible_country', True)" />
231 <field name="email_from"/>
232 <field name="phone"/>
234 <field name="categ_id" invisible="1"/>
235 <field name="type_id" invisible="1"/>
236 <field name="referred" invisible="1"/>
237 <field name="channel_id" invisible="1"/>
239 <field name="stage_id"/>
240 <button name="stage_previous" string="Previous Stage"
241 states="open,pending" type="object" icon="gtk-go-back" />
242 <button name="stage_next" string="Next Stage"
243 states="open,pending" type="object"
244 icon="gtk-go-forward" />
245 <field name="section_id" invisible="context.get('invisible_section', True)" />
246 <field name="user_id" />
247 <field name="state" />
248 <button name="case_open" string="Open"
249 states="draft,pending" type="object"
250 icon="gtk-go-forward" />
251 <button name="case_close" string="Close"
252 states="open,draft,pending" type="object"
254 <button string="Convert to Opportunity"
255 name="convert_opportunity"
256 states="draft,open,pending" icon="gtk-go-forward"
258 <button name="case_escalate" string="Escalate"
259 states="open,draft,pending" type="object"
265 <!-- CRM Lead Calendar View -->
267 <record model="ir.ui.view" id="crm_case_calendar_view_leads">
268 <field name="name">CRM - Leads Calendar</field>
269 <field name="model">crm.lead</field>
270 <field name="type">calendar</field>
271 <field name="priority" eval="2"/>
272 <field name="arch" type="xml">
273 <calendar string="Leads Generation"
274 date_start="create_date" color="user_id">
275 <field name="name" />
276 <field name="partner_name" />
277 <field name="partner_address_id" />
282 <!-- CRM Lead Search View -->
284 <record id="view_crm_case_leads_filter" model="ir.ui.view">
285 <field name="name">CRM - Leads Search</field>
286 <field name="model">crm.lead</field>
287 <field name="type">search</field>
288 <field name="arch" type="xml">
289 <search string="Search Leads">
290 <filter icon="terp-check"
292 default="1" name="current" help="Draft and Open Leads"
293 domain="[('state','in',('draft','open'))]"/>
294 <filter icon="terp-camera_test"
296 domain="[('state','=','open')]"/>
297 <filter icon="terp-gtk-media-pause"
299 domain="[('state','=','pending')]"/>
301 <separator orientation="vertical"/>
302 <filter icon="terp-go-today" string="Today"
303 domain="[('create_date','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]"
304 help="Todays' Leads" />
305 <filter icon="terp-go-week" string="7 Days"
306 help="Leads creating during last 7 days"
307 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'))]"
309 <separator orientation="vertical"/>
310 <field name="name" string="Subject"/>
311 <field name="partner_name"/>
312 <field name="email_from"/>
313 <field name="user_id">
314 <filter icon="terp-personal-"
315 domain="[('user_id','=', False)]"
316 help="Unassigned Leads" />
318 <field name="section_id" default="context.get('section_id', False)" widget="selection"
319 context="{'invisible_section': False}">
320 <filter icon="terp-personal+" groups="base.group_extended"
321 context="{'invisible_section': False}"
322 domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
323 help="My Sales Team(s)"/>
324 <filter icon="terp-personal+" groups="base.group_extended"
325 context="{'invisible_section': False}"
327 help="Show Sales Team"/>
331 <group expand="0" string="Extended Filters..." groups="base.group_extended">
332 <field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
333 <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
334 <separator orientation="vertical"/>
335 <field name="country_id" context="{'invisible_country': False}">
336 <filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
338 <separator orientation="vertical"/>
339 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
341 <field name="create_date" string="Creation Date"/>
342 <field name="date_closed"/>
345 <group expand="0" string="Group By...">
346 <filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
347 <filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
348 <filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
349 <separator orientation="vertical"/>
350 <filter string="Category" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'categ_id'}"/>
351 <filter string="Campaign" icon="terp-stock_symbol-selection"
352 domain="[]" context="{'group_by':'type_id'}" />
353 <filter string="Channel" icon="terp-call-start"
354 domain="[]" context="{'group_by':'channel_id'}" />
355 <separator orientation="vertical"/>
356 <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
357 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
358 <separator orientation="vertical"/>
359 <filter string="Creation" help="Create date" icon="terp-go-month"
360 domain="[]" context="{'group_by':'create_date'}" />