9 <!-- Stage Search view -->
10 <record id="crm_lead_stage_search" model="ir.ui.view">
11 <field name="name">Stage - Search</field>
12 <field name="model">crm.case.stage</field>
13 <field name="arch" type="xml">
14 <search string="Stage Search">
15 <field name="name" string="Stage Name"/>
22 <!-- Stage Form view -->
23 <record id="crm_lead_stage_act" model="ir.actions.act_window">
24 <field name="name">Stages</field>
25 <field name="res_model">crm.case.stage</field>
26 <field name="view_type">form</field>
27 <field name="view_id" ref="crm.crm_case_stage_tree"/>
28 <field name="help" type="html">
29 <p class="oe_view_nocontent_create">
30 Click to set a new stage in your lead/opportunity pipeline.
32 Stages will allow salespersons to easily track how a specific
33 lead or opportunity is positioned in the sales cycle.
38 <menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act" name="Stages" sequence="0" parent="base.menu_crm_config_lead" groups="base.group_no_one"/>
41 LEADS/OPPORTUNITIES CATEGORIES
44 <!-- Categories Form View -->
45 <record id="crm_lead_categ_action" model="ir.actions.act_window">
46 <field name="name">Sales Tags</field>
47 <field name="res_model">crm.case.categ</field>
48 <field name="view_type">form</field>
49 <field name="view_id" ref="crm_case_categ_tree-view"/>
50 <field name="context" eval="{'object_id': ref('model_crm_lead')}"/>
51 <field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
52 <field name="help" type="html">
53 <p class="oe_view_nocontent_create">
54 Click to define a new sales tag.
56 Create specific tags that fit your company's activities
57 to better classify and analyse your leads and opportunities.
58 Such categories could for instance reflect your product
59 structure or the different types of sales you do.
64 <menuitem action="crm_lead_categ_action"
65 id="menu_crm_lead_categ" name="Sales Tags"
66 parent="base.menu_crm_config_lead" sequence="1" groups="base.group_no_one"/>
72 id="act_crm_opportunity_crm_phonecall_new"
74 groups="base.group_sale_salesman"
75 res_model="crm.phonecall"
76 view_mode="tree,calendar,form"
77 context="{'default_duration': 1.0 ,'default_opportunity_id': active_id}"
81 id="act_crm_opportunity_crm_meeting_new"
83 res_model="crm.meeting"
84 view_mode="tree,form,calendar"
85 context="{'default_duration': 4.0, 'default_opportunity_id': active_id}"
89 <!-- CRM Lead Form View -->
90 <record model="ir.ui.view" id="crm_case_form_view_leads">
91 <field name="name">CRM - Leads Form</field>
92 <field name="model">crm.lead</field>
93 <field name="arch" type="xml">
94 <form string="Leads Form" version="7.0">
96 <button name="%(crm.action_crm_lead2opportunity_partner)d" string="Convert to Opportunity" type="action"
97 states="draft,open,pending" help="Convert to Opportunity" class="oe_highlight"/>
98 <button name="case_reset" string="Reset" type="object"
100 <button name="case_cancel" string="Cancel Case" type="object"
101 states="draft,open,pending"/>
102 <field name="stage_id" widget="statusbar" clickable="True"
103 domain="['&', '|', ('case_default', '=', True), ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"
104 on_change="onchange_stage_id(stage_id)"/>
107 <div class="oe_right oe_button_box" name="buttons">
108 <button string="Schedule/Log Call"
109 name="%(opportunity2phonecall_act)d"
112 <div class="oe_title">
113 <label for="name" class="oe_edit_only"/>
114 <h1><field name="name" placeholder="Describe the lead..."/></h1>
118 <field name="partner_name" string="Company Name"/>
119 <!-- Preload all the partner's information -->
120 <field name="partner_id" string="Customer"
121 on_change="on_change_partner(partner_id)"
122 options='{"create_name_field": "name"}'
123 context="{'default_name': contact_name, 'default_street': street, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_function': function, 'default_phone': phone, 'default_mobile': mobile, 'default_fax': fax, 'default_email': email_from, 'default_user_id': user_id, 'default_section_id': section_id}"/>
124 <label for="street" string="Address"/>
126 <field name="street" placeholder="Street..."/>
127 <field name="street2"/>
128 <div class="address_format">
129 <field name="city" placeholder="City" style="width: 40%%"/>
130 <field name="state_id" on_change="onchange_state(state_id)" options='{"no_open": True}' placeholder="State" style="width: 24%%"/>
131 <field name="zip" placeholder="ZIP" style="width: 34%%"/>
133 <field name="country_id" placeholder="Country" options='{"no_open": True}'/>
137 <label for="contact_name"/>
139 <field name="contact_name" class="oe_inline"/><span attrs="{'invisible': [('title', '=', '')]}">, </span>
140 <field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" class="oe_inline" options='{"no_open": True}'/>
142 <field name="email_from" widget="email"/>
143 <field name="function"/>
144 <field name="phone"/>
145 <field name="mobile"/>
148 This should be integrated in Open Chatter
149 <button string="Mail"
150 name="%(mail.action_email_compose_message_wizard)d"
151 icon="terp-mail-message-new" type="action" colspan="1"/>
155 <field name="user_id" on_change="on_change_user(user_id, context)"/>
156 <label for="section_id"/>
158 <field name="section_id"/>
159 <button name="case_escalate" string="Escalate" type="object" attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
161 <field name="type" invisible="1"/>
164 <field name="priority"/>
165 <field name="categ_ids"
166 widget="many2many_tags"
167 domain="[('object_id.model','=','crm.lead')]"
168 context="{'object_name': 'crm.lead'}"
172 <notebook colspan="4">
173 <page string="Internal Notes">
174 <field name="description"/>
176 <page string="Extra Info">
178 <group string="Categorization" groups="base.group_multi_company,base.group_no_one" name="categorization">
179 <field name="company_id"
180 groups="base.group_multi_company"
181 widget="selection" colspan="2"/>
182 <field name="state" groups="base.group_no_one"/>
184 <group string="Mailings">
185 <field name="opt_out"/>
187 <group string="Misc">
188 <field name="active"/>
189 <field name="referred"/>
195 <div class="oe_chatter">
196 <field name="message_follower_ids" widget="mail_followers"/>
197 <field name="message_ids" widget="mail_thread"/>
203 <!-- CRM Lead Graph View -->
204 <record model="ir.ui.view" id="crm_case_graph_view_leads">
205 <field name="name">Opportunities</field>
206 <field name="model">crm.lead</field>
207 <field name="arch" type="xml">
208 <graph string="Opportunities" type="bar">
209 <field name="stage_id"/>
210 <field name="planned_revenue" operator="+"/>
215 <!-- CRM Lead Tree View -->
216 <record model="ir.ui.view" id="crm_case_tree_view_leads">
217 <field name="name">Leads</field>
218 <field name="model">crm.lead</field>
219 <field name="arch" type="xml">
220 <tree string="Leads" fonts="bold:message_unread==True" colors="grey:state in ('cancel', 'done')">
221 <field name="date_deadline" invisible="1"/>
222 <field name="create_date"/>
224 <field name="contact_name"/>
225 <field name="country_id" invisible="context.get('invisible_country', True)"/>
226 <field name="email_from"/>
227 <field name="phone"/>
228 <field name="stage_id"/>
229 <field name="user_id" invisible="1"/>
230 <field name="partner_id" invisible="1"/>
231 <field name="section_id" invisible="context.get('invisible_section', True)"/>
232 <field name="state" invisible="1"/>
233 <field name="type_id" invisible="1"/>
234 <field name="referred" invisible="1"/>
235 <field name="channel_id" invisible="1"/>
236 <field name="message_unread" invisible="1"/>
242 <!-- CRM Lead Calendar View -->
243 <record model="ir.ui.view" id="crm_case_calendar_view_leads">
244 <field name="name">CRM - Leads Calendar</field>
245 <field name="model">crm.lead</field>
246 <field name="priority" eval="2"/>
247 <field name="arch" type="xml">
248 <calendar string="Leads Generation"
249 date_start="date_action" color="user_id">
251 <field name="partner_name"/>
256 <!-- CRM Lead Kanban View -->
257 <record model="ir.ui.view" id="crm_case_kanban_view_leads">
258 <field name="name">CRM - Leads Kanban</field>
259 <field name="model">crm.lead</field>
260 <field name="arch" type="xml">
261 <kanban default_group_by="stage_id">
262 <field name="state" groups="base.group_no_one"/>
263 <field name="stage_id"/>
264 <field name="color"/>
265 <field name="priority"/>
266 <field name="planned_revenue" sum="Expected Revenues"/>
267 <field name="user_email"/>
268 <field name="user_id"/>
269 <field name="partner_address_email"/>
270 <field name="message_summary"/>
271 <field name="message_unread"/>
273 <field name="date_deadline"/>
274 <t t-name="kanban-box">
275 <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
276 <div class="oe_dropdown_toggle oe_dropdown_kanban">
277 <span class="oe_e">Ã</span>
278 <ul class="oe_dropdown_menu">
279 <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
280 <t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
281 <li><a name="%(mail.action_email_compose_message_wizard)d" type="action">Send Email</a></li>
282 <li><a name="%(opportunity2phonecall_act)d" type="action">Schedule/Log Call</a></li>
283 <li><a name="action_makeMeeting" type="object">Schedule Meeting</a></li>
284 <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
287 <div class="oe_kanban_content">
289 <b><field name="name"/></b>
290 <t t-if="record.planned_revenue.raw_value">
291 - <b><t t-esc="record.planned_revenue.value"/>
292 <field name="company_currency"/></b>
296 <field name="partner_id"/>
298 <div style="padding-left: 0.5em">
299 <t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())" t-set="red">oe_kanban_text_red</t>
300 <span t-attf-class="#{red || ''}"><field name="date_action"/></span>
301 <t t-if="record.date_action.raw_value"> : </t>
302 <field name="title_action"/>
304 <div class="oe_kanban_bottom_right">
305 <a t-if="record.priority.raw_value == 1" type="object" name="set_normal_priority" class="oe_e oe_star_on">7</a>
306 <a t-if="record.priority.raw_value != 1" type="object" name="set_high_priority" class="oe_e oe_star_off">7</a>
307 <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar" t-if="record.user_id.value"/>
309 <div class="oe_kanban_footer_left">
310 <t t-raw="record.message_summary.raw_value"/>
313 <div class="oe_clear"></div>
321 <!-- CRM Lead Search View -->
322 <record id="view_crm_case_leads_filter" model="ir.ui.view">
323 <field name="name">CRM - Leads Search</field>
324 <field name="model">crm.lead</field>
325 <field name="arch" type="xml">
326 <search string="Search Leads">
327 <field name="name" string="Lead / Customer" filter_domain="['|','|','|',('partner_name','ilike',self),('email_from','ilike',self),('contact_name','ilike',self),('name','ilike',self)]"/>
328 <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/>
329 <field name="section_id" context="{'invisible_section': False}"/>
330 <field name="user_id"/>
331 <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
332 <field name="create_date"/>
333 <field name="country_id" context="{'invisible_country': False}"/>
335 <filter string="Open" name="open" domain="[('state','!=','cancel')]" help="Open Leads"/>
336 <filter string="Dead" name="dead" domain="[('state','=','cancel')]"/>
337 <filter string="Unassigned" domain="[('user_id','=', False)]" help="No salesperson"/>
338 <filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]" help="Unread messages"/>
339 <filter string="Assigned to Me"
340 domain="[('user_id','=',uid)]" context="{'invisible_section': False}"
341 help="Leads that are assigned to me"/>
342 <filter string="Assigned to My Team(s)"
343 domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
344 help="Leads that are assigned to any sales teams I am member of"/>
346 <filter string="Available for mass mailing"
347 name='not_opt_out' domain="[('opt_out', '=', False)]"
348 help="Leads that did not ask not to be included in mass mailing campaigns"/>
350 <group expand="0" string="Group By...">
351 <filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}"/>
352 <filter string="Team" domain="[]" context="{'group_by':'section_id'}"/>
353 <filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
354 <filter string="Customer" help="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
355 <filter string="Country" domain="[]" context="{'group_by':'country_id'}"/>
356 <filter string="Referrer" domain="[]" context="{'group_by':'referred'}"/>
357 <filter string="Campaign" domain="[]" context="{'group_by':'type_id'}"/>
358 <filter string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
359 <filter string="Creation" domain="[]" context="{'group_by':'create_date'}"/>
361 <group string="Display">
362 <filter string="Show Countries" context="{'invisible_country': False}" help="Show Countries"/>
363 <filter string="Show Sales Team" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
374 <!-- Opportunities Form View -->
375 <record model="ir.ui.view" id="crm_case_form_view_oppor">
376 <field name="name">Opportunities</field>
377 <field name="model">crm.lead</field>
378 <field name="priority">20</field>
379 <field name="arch" type="xml">
380 <form string="Opportunities" version="7.0">
382 <button name="case_mark_won" string="Mark Won" type="object"
383 states="draft,open,pending" class="oe_highlight"/>
384 <button name="case_mark_lost" string="Mark Lost" type="object"
385 states="draft,open" class="oe_highlight"/>
386 <field name="stage_id" widget="statusbar" clickable="True"/>
389 <div class="oe_right oe_button_box">
390 <button string="Schedule/Log Call"
391 name="%(opportunity2phonecall_act)d"
393 <button string="Meeting"
394 name="action_makeMeeting"
396 context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"/>
398 <div class="oe_title">
399 <label for="name" class="oe_edit_only"/>
400 <h1><field name="name"/></h1>
401 <label for="planned_revenue" class="oe_edit_only"/>
403 <field name="company_currency" invisible="1"/>
404 <field name="planned_revenue" class="oe_inline" widget='monetary' options="{'currency_field': 'company_currency'}"/>
405 <span class="oe_grey"> at </span>
406 <field name="probability" class="oe_inline" widget="integer"/>%%
411 <field name="partner_id"
412 on_change="onchange_partner_id(partner_id, email_from)"
414 context="{'default_name': partner_name, 'default_email': email_from, 'default_phone': phone}"/>
415 <field name="email_from" string="Email" widget="email"/>
416 <field name="phone"/>
420 <label for="title_action"/>
422 <field name="date_action" nolabel="1"/> <label string="-" attrs="{'invisible': ['|', ('date_action', '=', False), ('title_action', '=', False)]}"/>
423 <field name="title_action" class="oe_inline" nolabel="1" placeholder="e.g. Call for proposal"/>
425 <field name="date_deadline"/>
426 <field name="priority"/>
430 <field name="user_id" on_change="on_change_user(user_id, context)"/>
431 <label for="section_id"/>
433 <field name="section_id" widget="selection"/>
434 <button name="case_escalate" string="Escalate" type="object" class="oe_link" attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
438 <field name="categ_ids"
439 string="Categories" widget="many2many_tags"
440 context = "{'object_name': 'crm.lead'}"
441 domain="[('object_id.model', '=', 'crm.lead')]"/>
446 <notebook colspan="4">
447 <page string="Internal Notes">
448 <field name="description"/>
453 <field name="partner_name"/>
454 <label for="street" string="Address"/>
456 <field name="street" placeholder="Street..."/>
457 <field name="street2"/>
458 <div class="address_format">
459 <field name="city" placeholder="City" style="width: 40%%"/>
460 <field name="state_id" options='{"no_open": True}' on_change="onchange_state(state_id)" placeholder="State" style="width: 24%%"/>
461 <field name="zip" placeholder="ZIP" style="width: 34%%"/>
463 <field name="country_id" placeholder="Country" options='{"no_open": True}'/>
468 <label for="contact_name"/>
470 <field name="contact_name" class="oe_inline"/>
471 <field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" options='{"no_open": True}' class="oe_inline"/>
473 <field name="function"/>
474 <field name="mobile"/>
477 <group string="Mailings" name="mailings">
478 <field name="opt_out"/>
480 <group string="Misc">
481 <field name="active"/>
482 <field name="day_open" groups="base.group_no_one"/>
483 <field name="day_close" groups="base.group_no_one"/>
484 <field name="referred"/>
485 <field name="state" invisible="1"/>
486 <field name="type" invisible="1"/>
488 <group string="References">
494 <page string="Fund Raising" groups="crm.group_fund_raising">
496 <field name="payment_mode" widget="selection"/>
497 <field name="planned_cost"/>
502 <div class="oe_chatter">
503 <field name="message_follower_ids" widget="mail_followers"/>
504 <field name="message_ids" widget="mail_thread"/>
510 <!-- Opportunities Tree View -->
511 <record model="ir.ui.view" id="crm_case_tree_view_oppor">
512 <field name="name">Opportunities Tree</field>
513 <field name="model">crm.lead</field>
514 <field name="arch" type="xml">
515 <tree string="Opportunities" fonts="bold:message_unread==True" colors="gray:state in ('cancel', 'done');red:date_deadline and (date_deadline < current_date)">
516 <field name="date_deadline" invisible="1"/>
517 <field name="create_date"/>
518 <field name="name" string="Opportunity"/>
519 <field name="partner_id" string="Customer"/>
520 <field name="country_id" invisible="context.get('invisible_country', True)"/>
521 <field name="date_action"/>
522 <field name="title_action"/>
523 <field name="channel_id" invisible="1"/>
524 <field name="type_id" invisible="1"/>
525 <field name="stage_id"/>
526 <field name="planned_revenue" sum="Expected Revenues"/>
527 <field name="probability" avg="Avg. of Probability"/>
528 <field name="section_id" invisible="context.get('invisible_section', True)"/>
529 <field name="user_id"/>
530 <field name="referred" invisible="1"/>
531 <field name="priority" invisible="1"/>
532 <field name="message_unread" invisible="1"/>
533 <field name="state" invisible="1"/>
539 <!-- Opportunities Search View -->
540 <record id="view_crm_case_opportunities_filter" model="ir.ui.view">
541 <field name="name">CRM - Opportunities Search</field>
542 <field name="model">crm.lead</field>
543 <field name="arch" type="xml">
544 <search string="Search Opportunities">
545 <field name="name" string="Opportunity" filter_domain="['|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self)]"/>
546 <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]"/>
547 <field name="section_id" context="{'invisible_section': False}"/>
548 <field name="user_id"/>
549 <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
551 <filter string="New" name="new" domain="[('state','=','draft')]" help="New Opportunities"/>
552 <filter string="In Progress" name="open" domain="[('state','=','open')]" help="Open Opportunities"/>
553 <filter string="Won" name="won" domain="[('state','=','done')]"/>
554 <filter string="Lost" name="lost" domain="[('state','=','cancel')]"/>
555 <filter string="Unassigned" domain="[('user_id','=', False)]" help="No salesperson"/>
556 <filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]" help="Unread messages"/>
557 <filter string="Assigned to Me"
558 domain="[('user_id','=',uid)]" context="{'invisible_section': False}"
559 help="Opportunities that are assigned to me"/>
560 <filter string="Assigned to My Team(s)"
561 domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
562 help="Opportunities that are assigned to any sales teams I am member of"/>
564 <group expand="0" string="Group By..." colspan="16">
565 <filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}"/>
566 <filter string="Team" domain="[]" context="{'group_by':'section_id'}"/>
567 <filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
568 <filter string="Customer" help="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
569 <filter string="Country" domain="[]" context="{'group_by':'country_id'}"/>
570 <filter string="Priority" domain="[]" context="{'group_by':'priority'}"/>
571 <filter string="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}"/>
572 <filter string="Referrer" domain="[]" context="{'group_by':'referred'}"/>
573 <filter string="Campaign" domain="[]" context="{'group_by':'type_id'}"/>
574 <filter string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
575 <filter string="Creation" domain="[]" context="{'group_by':'create_date'}"/>
577 <group string="Display">
578 <filter string="Show Sales Team" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
579 <filter string="Show Countries" context="{'invisible_country': False}" help="Show Countries"/>