5 <!-- Read/Unread actions -->
6 <record id="actions_server_crm_lead_unread" model="ir.actions.server">
7 <field name="name">Mark unread</field>
8 <field name="condition">True</field>
9 <field name="type">ir.actions.server</field>
10 <field name="model_id" ref="model_crm_lead"/>
11 <field name="state">code</field>
12 <field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
14 <record id="action_crm_lead_unread" model="ir.values">
15 <field name="name">action_crm_lead_unread</field>
16 <field name="action_id" ref="actions_server_crm_lead_unread"/>
17 <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_unread'))" />
18 <field name="key">action</field>
19 <field name="model_id" ref="model_crm_lead" />
20 <field name="model">crm.lead</field>
21 <field name="key2">client_action_multi</field>
24 <record id="actions_server_crm_lead_read" model="ir.actions.server">
25 <field name="name">Mark read</field>
26 <field name="condition">True</field>
27 <field name="type">ir.actions.server</field>
28 <field name="model_id" ref="model_crm_lead"/>
29 <field name="state">code</field>
30 <field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
32 <record id="action_crm_lead_read" model="ir.values">
33 <field name="name">action_crm_lead_read</field>
34 <field name="action_id" ref="actions_server_crm_lead_read"/>
35 <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_crm_lead_read'))" />
36 <field name="key">action</field>
37 <field name="model_id" ref="model_crm_lead" />
38 <field name="model">crm.lead</field>
39 <field name="key2">client_action_multi</field>
46 <!-- Stage Search view -->
47 <record id="crm_lead_stage_search" model="ir.ui.view">
48 <field name="name">Stage - Search</field>
49 <field name="model">crm.case.stage</field>
50 <field name="arch" type="xml">
51 <search string="Stage Search">
52 <field name="name" string="Stage Name"/>
59 <!-- Stage Form view -->
60 <record id="crm_lead_stage_act" model="ir.actions.act_window">
61 <field name="name">Stages</field>
62 <field name="res_model">crm.case.stage</field>
63 <field name="view_type">form</field>
64 <field name="view_id" ref="crm.crm_case_stage_tree"/>
65 <field name="help" type="html">
66 <p class="oe_view_nocontent_create">
67 Click to set a new stage in your lead/opportunity pipeline.
69 Stages will allow salespersons to easily track how a specific
70 lead or opportunity is positioned in the sales cycle.
75 <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"/>
78 LEADS/OPPORTUNITIES CATEGORIES
81 <!-- Categories Form View -->
82 <record id="crm_lead_categ_action" model="ir.actions.act_window">
83 <field name="name">Sales Tags</field>
84 <field name="res_model">crm.case.categ</field>
85 <field name="view_type">form</field>
86 <field name="view_id" ref="crm_case_categ_tree-view"/>
87 <field name="context" eval="{'object_id': ref('model_crm_lead')}"/>
88 <field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
89 <field name="help" type="html">
90 <p class="oe_view_nocontent_create">
91 Click to define a new sales tag.
93 Create specific tags that fit your company's activities
94 to better classify and analyse your leads and opportunities.
95 Such categories could for instance reflect your product
96 structure or the different types of sales you do.
101 <menuitem action="crm_lead_categ_action"
102 id="menu_crm_lead_categ" name="Sales Tags"
103 parent="base.menu_crm_config_lead" sequence="1" groups="base.group_no_one"/>
109 id="act_crm_opportunity_crm_phonecall_new"
111 groups="base.group_sale_salesman"
112 res_model="crm.phonecall"
113 view_mode="tree,calendar,form"
114 context="{'default_duration': 1.0 ,'default_opportunity_id': active_id}"
118 id="act_crm_opportunity_crm_meeting_new"
120 res_model="crm.meeting"
121 view_mode="tree,form,calendar"
122 context="{'default_duration': 4.0, 'default_opportunity_id': active_id}"
126 <!-- CRM Lead Form View -->
127 <record model="ir.ui.view" id="crm_case_form_view_leads">
128 <field name="name">CRM - Leads Form</field>
129 <field name="model">crm.lead</field>
130 <field name="arch" type="xml">
131 <form string="Leads Form" version="7.0">
133 <button name="%(crm.action_crm_lead2opportunity_partner)d" string="Convert to Opportunity" type="action"
134 states="draft,open,pending" help="Convert to Opportunity" class="oe_highlight"/>
135 <button name="case_escalate" string="Escalate" type="object"
136 states="draft,open,pending"/>
137 <button name="case_reset" string="Reset" type="object"
139 <button name="case_cancel" string="Cancel" type="object"
140 states="draft,open,pending"/>
141 <field name="stage_id" widget="statusbar"
142 on_change="onchange_stage_id(stage_id)"/>
145 <div class="oe_right oe_button_box" name="buttons">
146 <button type="action"
147 name="%(act_crm_opportunity_crm_phonecall_new)d"
148 string="Phone Calls" />
150 <div class="oe_title">
151 <label for="name" class="oe_edit_only" string="Lead Description"/>
152 <h1><field name="name" placeholder="Describe the lead..."/></h1>
156 <field name="partner_name" string="Company Name"/>
157 <field name="partner_id" string="Customer"
158 on_change="on_change_partner(partner_id)" options='{"create_name_field": "name"}'/>
159 <label for="street" string="Address"/>
161 <field name="street" placeholder="Street..."/>
162 <field name="street2"/>
163 <div class="address_format">
164 <field name="city" placeholder="City" style="width: 40%%"/>
165 <field name="state_id" options='{"no_open": true}' placeholder="State" style="width: 24%%"/>
166 <field name="zip" placeholder="ZIP" style="width: 34%%"/>
168 <field name="country_id" placeholder="Country" options='{"no_open": true}'/>
172 <label for="contact_name" />
174 <field name="contact_name" class="oe_inline"/>,
175 <field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" class="oe_inline" options='{"no_open": true}'/>
177 <field name="email_from" widget="email"/>
178 <field name="function" />
179 <field name="phone"/>
180 <field name="mobile"/>
183 This should be integrated in Open Chatter
184 <button string="Mail"
185 name="%(mail.action_email_compose_message_wizard)d"
186 icon="terp-mail-message-new" type="action" colspan="1"/>
190 <field name="user_id"/>
191 <field name="section_id"/>
192 <field name="type" invisible="1"/>
195 <field name="priority"/>
196 <field name="categ_ids"
197 widget="many2many_tags"
198 domain="[('object_id.model','=','crm.lead')]"/>
201 <notebook colspan="4">
202 <page string="Notes">
203 <field name="description"/>
205 <page string="Extra Info">
207 <group string="Categorization">
208 <field name="company_id"
209 groups="base.group_multi_company"
210 widget="selection" colspan="2" />
211 <field name="type_id" widget="selection"/>
212 <field name="channel_id" widget="selection"/>
213 <field name="referred"/>
214 <field name="state" groups="base.group_no_one"/>
216 <group string="Mailings">
217 <field name="opt_out" />
223 <div class="oe_chatter">
224 <field name="message_ids" widget="mail_thread"/>
225 <field name="message_follower_ids" widget="mail_followers"/>
231 <!-- CRM Lead Graph View -->
232 <record model="ir.ui.view" id="crm_case_graph_view_leads">
233 <field name="name">Opportunities</field>
234 <field name="model">crm.lead</field>
235 <field name="arch" type="xml">
236 <graph string="Opportunities" type="bar">
237 <field name="stage_id"/>
238 <field name="planned_revenue" operator="+"/>
244 <!-- CRM Lead Tree View -->
245 <record model="ir.ui.view" id="crm_case_tree_view_leads">
246 <field name="name">Leads</field>
247 <field name="model">crm.lead</field>
248 <field name="arch" type="xml">
249 <tree string="Leads" fonts="bold:message_unread==True" colors="grey:state in ('cancel', 'done')">
250 <field name="date_deadline" invisible="1"/>
251 <field name="create_date" groups="base.group_no_one"/>
253 <field name="contact_name"/>
254 <field name="country_id" invisible="context.get('invisible_country', True)" />
255 <field name="email_from"/>
256 <field name="phone"/>
257 <field name="stage_id"/>
258 <field name="user_id" invisible="1"/>
259 <field name="section_id" invisible="context.get('invisible_section', True)" />
260 <field name="state" groups="base.group_no_one"/>
261 <field name="type_id" invisible="1"/>
262 <field name="referred" invisible="1"/>
263 <field name="channel_id" invisible="1"/>
264 <field name="message_unread" invisible="1"/>
269 <!-- CRM Lead Calendar View -->
270 <record model="ir.ui.view" id="crm_case_calendar_view_leads">
271 <field name="name">CRM - Leads Calendar</field>
272 <field name="model">crm.lead</field>
273 <field name="priority" eval="2"/>
274 <field name="arch" type="xml">
275 <calendar string="Leads Generation"
276 date_start="date_action" color="user_id">
277 <field name="name" />
278 <field name="partner_name" />
283 <!-- CRM Lead Kanban View -->
284 <record model="ir.ui.view" id="crm_case_kanban_view_leads">
285 <field name="name">CRM - Leads Kanban</field>
286 <field name="model">crm.lead</field>
287 <field name="arch" type="xml">
288 <kanban default_group_by="stage_id">
289 <field name="state" groups="base.group_no_one"/>
290 <field name="stage_id"/>
291 <field name="color"/>
292 <field name="priority"/>
293 <field name="planned_revenue" sum="Expected Revenues"/>
294 <field name="user_email"/>
295 <field name="user_id"/>
296 <field name="partner_address_email"/>
297 <field name="message_summary"/>
298 <field name="message_unread"/>
300 <t t-name="lead_details">
301 <ul class="oe_kanban_tooltip oe_semantic_html_override">
302 <li t-if="record.phone.raw_value"><b>Phone:</b> <field name="phone"/></li>
303 <li><b>Probability:</b> <field name="probability"/>%%</li>
304 <li><b>Creation date:</b> <field name="create_date"/></li>
305 <li t-if="record.date_deadline.raw_value"><b>Date Deadline:</b> <field name="date_deadline"/></li>
308 <t t-name="kanban-box">
309 <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
310 <div class="oe_dropdown_toggle oe_dropdown_kanban oe_semantic_html_override">
311 <span class="oe_e">Ã</span>
312 <ul class="oe_dropdown_menu">
313 <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
314 <t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
315 <li><a name="%(mail.action_email_compose_message_wizard)d" type="action">Send Email</a></li>
316 <li><a name="%(opportunity2phonecall_act)d" type="action">Log Call</a></li>
317 <li><a name="action_makeMeeting" type="object">Schedule Meeting</a></li>
318 <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
321 <div class="oe_kanban_content">
323 <b><field name="name"/></b>
324 <t t-if="record.planned_revenue.raw_value">
325 - <b><t t-esc="Math.round(record.planned_revenue.value)"/>
326 <field name="company_currency"/></b>
330 <field name="partner_id"/>
332 <div style="padding-left: 0.5em">
333 <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>
334 <span t-attf-class="#{red || ''}"><field name="date_action"/></span>
335 <t t-if="record.date_action.raw_value"> : </t>
336 <field name="title_action"/>
338 <div class="oe_kanban_bottom_right">
339 <a t-if="record.priority.raw_value == 1" type="object" name="set_normal_priority" class="oe_e oe_star_on">7</a>
340 <a t-if="record.priority.raw_value != 1" type="object" name="set_high_priority" class="oe_e oe_star_off">7</a>
341 <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"/>
343 <div class="oe_kanban_footer_left">
344 <t t-raw="record.message_summary.raw_value"/>
347 <div class="oe_clear"></div>
355 <!-- CRM Lead Search View -->
356 <record id="view_crm_case_leads_filter" model="ir.ui.view">
357 <field name="name">CRM - Leads Search</field>
358 <field name="model">crm.lead</field>
359 <field name="arch" type="xml">
360 <search string="Search Leads">
361 <field name="name" string="Lead / Customer" filter_domain="['|','|',('partner_name','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
362 <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]" />
363 <field name="create_date"/>
364 <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
366 <filter icon="terp-check" string="New" name="new" help="New Leads" domain="[('state','=','draft')]"/>
367 <filter icon="terp-camera_test" string="Open" name="open" domain="[('state','=','open')]"/>
369 <filter string="Unassigned Leads" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Leads" />
371 <filter string="Leads Assigned to Me or My Team(s)" icon="terp-personal+" context="{'invisible_section': False}"
372 domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
373 help="Leads that are assigned to one of the sale teams I manage, or to me"/>
374 <field name="user_id"/>
375 <field name="section_id" context="{'invisible_section': False}"/>
376 <field name="country_id" context="{'invisible_country': False}"/>
377 <group expand="0" string="Group By...">
378 <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
379 <filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
380 <filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
381 <filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}" />
382 <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
383 <separator orientation="vertical"/>
384 <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
385 <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
386 <filter string="Creation" help="Create date" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
388 <group string="Display">
389 <filter string="Show Countries" icon="terp-personal+" context="{'invisible_country': False}" help="Show Countries"/>
390 <filter string="Show Sales Team" icon="terp-personal+" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>
401 <!-- Opportunities Form View -->
402 <record model="ir.ui.view" id="crm_case_form_view_oppor">
403 <field name="name">Opportunities</field>
404 <field name="model">crm.lead</field>
405 <field name="priority">20</field>
406 <field name="arch" type="xml">
407 <form string="Opportunities" version="7.0">
409 <button name="case_mark_won" string="Mark Won" type="object"
410 states="draft,open,pending" class="oe_highlight"/>
411 <button name="case_mark_lost" string="Mark Lost" type="object"
412 states="draft,open" class="oe_highlight"/>
413 <button name="case_escalate" string="Escalate" type="object"
415 <field name="stage_id" widget="statusbar" clickable="True"/>
418 <div class="oe_right oe_button_box">
419 <button string="Schedule/Log Call"
420 name="%(opportunity2phonecall_act)d"
422 <button string="Meeting"
423 name="action_makeMeeting"
425 context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"
428 <div class="oe_title">
429 <label for="name" class="oe_edit_only"/>
430 <h1><field name="name"/></h1>
431 <label for="planned_revenue" class="oe_edit_only"/>
433 <field name="planned_revenue" class="oe_inline"/>
434 <field name="company_currency" class="oe_inline"/> at
435 <field name="probability" class="oe_inline" widget="integer"/>%% success rate
440 <field name="partner_id"
441 on_change="onchange_partner_id(partner_id, email_from)"
443 context="{'default_name': partner_name, 'default_email': email_from, 'default_phone': phone}"/>
444 <field name="email_from" string="Email"/>
445 <field name="phone"/>
449 <label for="title_action"/>
451 <field name="date_action" nolabel="1"/> <label string="-" attrs="{'invisible': ['|', ('date_action', '=', False), ('title_action', '=', False)]}"/>
452 <field name="title_action" class="oe_inline" nolabel="1" placeholder="e.g. Call for proposal"/>
454 <field name="date_deadline"/>
455 <field name="priority"/>
459 <field name="user_id"/>
460 <field name="section_id" colspan="1" widget="selection"/>
463 <field name="categ_ids"
464 string="Categories" widget="many2many_tags"
465 domain="[('object_id.model', '=', 'crm.lead')]"/>
470 <notebook colspan="4">
471 <page string="Internal Notes">
472 <field name="description"/>
477 <field name="partner_name"/>
478 <label for="street" string="Address"/>
480 <field name="street" placeholder="Street..."/>
481 <field name="street2"/>
482 <div class="address_format">
483 <field name="city" placeholder="City" style="width: 40%%"/>
484 <field name="state_id" options='{"no_open": true}' placeholder="State" style="width: 24%%"/>
485 <field name="zip" placeholder="ZIP" style="width: 34%%"/>
487 <field name="country_id" placeholder="Country" options='{"no_open": true}'/>
492 <label for="contact_name" />
494 <field name="contact_name" class="oe_inline"/>
495 <field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" options='{"no_open": true}' class="oe_inline"/>
497 <field name="function" />
498 <field name="mobile"/>
502 <group string="Categorization">
503 <field name="type_id" widget="selection"/>
504 <field name="channel_id" widget="selection"/>
506 <group string="Mailings">
507 <field name="opt_out" />
509 <group string="Misc">
510 <field name="active"/>
511 <field name="day_open" groups="base.group_no_one"/>
512 <field name="day_close" groups="base.group_no_one"/>
513 <field name="referred"/>
514 <field name="state" groups="base.group_no_one"/>
515 <field name="type" invisible="1"/>
517 <group string="References">
523 <page string="Fund Raising" groups="crm.group_fund_raising">
525 <field name="payment_mode" widget="selection"/>
526 <field name="planned_cost"/>
531 <div class="oe_chatter">
532 <field name="message_ids" widget="mail_thread"/>
533 <field name="message_follower_ids" widget="mail_followers"/>
539 <!-- Opportunities Tree View -->
540 <record model="ir.ui.view" id="crm_case_tree_view_oppor">
541 <field name="name">Opportunities Tree</field>
542 <field name="model">crm.lead</field>
543 <field name="arch" type="xml">
544 <tree string="Opportunities" fonts="bold:message_unread==True" colors="gray:state in ('cancel', 'done');red:date_deadline and (date_deadline < current_date)">
545 <field name="date_deadline" invisible="1"/>
546 <field name="create_date" groups="base.group_no_one"/>
547 <field name="name" string="Opportunity"/>
548 <field name="partner_id" string="Customer"/>
549 <field name="country_id" invisible="context.get('invisible_country', True)" />
550 <field name="date_action"/>
551 <field name="title_action" />
552 <field name="channel_id" invisible="1"/>
553 <field name="type_id" invisible="1"/>
554 <field name="stage_id"/>
555 <field name="planned_revenue" sum="Expected Revenues"/>
556 <field name="probability" widget="progressbar" avg="Avg. of Probability"/>
557 <field name="section_id" invisible="context.get('invisible_section', True)" />
558 <field name="user_id"/>
559 <field name="priority" invisible="1"/>
560 <field name="state" groups="base.group_no_one"/>
561 <field name="message_unread" invisible="1"/>
567 <!-- Opportunities Search View -->
568 <record id="view_crm_case_opportunities_filter" model="ir.ui.view">
569 <field name="name">CRM - Opportunities Search</field>
570 <field name="model">crm.lead</field>
571 <field name="arch" type="xml">
572 <search string="Search Opportunities">
573 <field name="name" string="Opportunity / Customer"
574 filter_domain="['|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self)]"/>
575 <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]" />
576 <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="message_unread" domain="[('message_unread','=',True)]"/>
578 <filter icon="terp-check" string="New" help="New Opportunities" name="new" domain="[('state','=','draft')]"/>
579 <filter icon="terp-camera_test" string="Open" help="Open Opportunities" name="open" domain="[('state','=','open')]"/>
581 <filter string="Unassigned Opportunities" icon="terp-personal-" domain="[('user_id','=', False)]" help="Unassigned Opportunities" />
583 <filter string="Opportunities Assigned to Me or My Team(s)" icon="terp-personal+"
584 domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
585 help="Opportunities that are assigned to either me or one of the sale teams I manage" />
586 <field name="user_id"/>
587 <field name="country_id"/>
588 <field name="partner_id"/>
589 <field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/>
590 <group expand="0" string="Group By..." colspan="16">
591 <filter string="Salesperson" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
592 <filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
593 <filter string="Customer" help="Partner" icon="terp-personal+" domain="[]" context="{'group_by':'partner_id'}"/>
594 <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" />
595 <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
596 <filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}"/>
597 <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
598 <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
599 <filter string="Creation" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" groups="base.group_no_one"/>
600 <filter string="Exp.Closing" icon="terp-go-month" help="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}" />
602 <group string="Display">
603 <filter string="Show Sales Team" icon="terp-personal+" context="{'invisible_section': False}" domain="[]" help="Show Sales Team"/>