5 <!-- Stage Search view -->
6 <record id="crm_lead_stage_search" model="ir.ui.view">
7 <field name="name">Stage - Search</field>
8 <field name="model">crm.case.stage</field>
9 <field name="type">search</field>
10 <field name="arch" type="xml">
11 <search string="Stage Search">
17 <!--Lead Stage Form view -->
18 <record id="crm_lead_stage_act" model="ir.actions.act_window">
19 <field name="name">Stages</field>
20 <field name="res_model">crm.case.stage</field>
21 <field name="view_type">form</field>
22 <field name="view_id" ref="crm.crm_case_stage_tree"/>
23 <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>
26 <menuitem action="crm_lead_stage_act" id="menu_crm_lead_stage_act" name="Stages"
27 groups="base.group_extended" sequence="0"
28 parent="base.menu_crm_config_lead" />
31 <!-- Lead/Opportunity Categories Action -->
33 <record id="crm_lead_categ_action" model="ir.actions.act_window">
34 <field name="name">Categories</field>
35 <field name="res_model">crm.case.categ</field>
36 <field name="view_type">form</field>
37 <field name="view_id" ref="crm_case_categ_tree-view"/>
38 <field name="context">{'object_id': 'crm.lead'}</field>
39 <field name="domain">[('object_id.model', '=', 'crm.lead')]</field>
40 <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>
43 <menuitem action="crm_lead_categ_action"
44 id="menu_crm_lead_categ" name="Categories"
45 parent="base.menu_crm_config_lead" sequence="1"/>
48 <!-- CRM Lead Form View -->
49 <record model="ir.ui.view" id="crm_case_form_view_leads">
50 <field name="name">CRM - Leads Form</field>
51 <field name="model">crm.lead</field>
52 <field name="type">form</field>
53 <field name="arch" type="xml">
54 <form string="Leads Form">
55 <group colspan="4" col="7">
56 <field name="name" required="1" string="Subject"/>
57 <field name="priority"/>
58 <field name="categ_id"
60 domain="[('object_id.model','=','crm.lead')]"/>
62 name="%(crm.action_crm_lead2opportunity_partner)d"
63 string="Convert to Opportunity"
64 help="Convert to Opportunity" icon="gtk-go-forward"
68 <field name="user_id" />
69 <field name="section_id" widget="selection" />
70 <field name="stage_id" domain="[('section_ids', '=', section_id)]" />
71 <group col="2" colspan="1">
72 <button name="stage_previous" string=""
73 states="open,pending,draft" type="object"
74 icon="gtk-go-back" context="{'stage_type': 'lead'}" />
75 <button name="stage_next" string=""
76 states="open,pending,draft" type="object"
77 icon="gtk-go-forward" context="{'stage_type': 'lead'}" />
79 <field name="type" invisible="1"/>
81 <notebook colspan="4">
83 <group colspan="4" col="2">
84 <field name="partner_name" string="Partner Name" />
86 <group colspan="2" col="4">
87 <separator string="Contact" colspan="4" col="4"/>
88 <field name="contact_name" colspan="4"/>
90 <field domain="[('domain', '=', 'contact')]" name="title" widget="selection"/>
91 <field name="function" />
92 <field name="street" colspan="4"/>
93 <field name="street2" colspan="4"/>
96 <field name="country_id"/>
97 <field name="state_id"/>
99 <group colspan="2" col="3">
100 <separator string="Communication" colspan="4" col="3"/>
101 <field name="email_from" widget="email"/>
102 <button string="Mail"
103 name="%(mail.action_email_compose_message_wizard)d"
104 icon="terp-mail-message-new" type="action" colspan="1"/>
106 <field name="phone"/>
110 <field name="mobile"/>
112 <separator string="Links" colspan="4" col="3"/>
113 <field name="partner_id" string="Customer"/>
115 name="%(action_crm_lead2partner)d"
116 icon="terp-partner" type="action"
118 attrs="{'invisible':[('partner_id','!=',False)]}"/>
120 <separator colspan="4" string="Notes"/>
121 <field name="description" nolabel="1" colspan="4"/>
122 <separator colspan="4"/>
123 <group col="8" colspan="4">
124 <field name="state" widget="statusbar" statusbar_visible="draft,open,done" statusbar_colors='{"pending":"blue"}'/>
125 <button name="case_cancel" string="Cancel"
126 states="draft,open,pending" type="object"
128 <button name="case_open" string="Open"
129 states="draft,pending" type="object"
130 icon="gtk-go-forward" />
131 <button name="case_mark_lost" string="Close"
132 states="open,pending" type="object"
134 <button name="case_pending" string="Pending"
135 states="open" type="object"
136 icon="gtk-media-pause" />
137 <button name="case_escalate" string="Escalate"
138 states="open,pending" type="object"
139 groups="base.group_extended"
141 <button name="case_reset"
142 string="Reset to Draft" states="done,cancel"
143 type="object" icon="gtk-convert" />
146 <page string="Extra Info" groups="base.group_extended">
147 <group colspan="2" col="2">
148 <separator string="Categorization" colspan="2" col="2"/>
149 <field name="company_id"
150 groups="base.group_multi_company"
151 widget="selection" colspan="2" />
152 <field name="type_id" select="1" widget="selection"/>
153 <field name="channel_id" select="1" widget="selection"/>
154 <field name="referred"/>
156 <group colspan="2" col="2">
157 <separator string="Dates" colspan="2" col="2"/>
158 <field name="create_date"/>
159 <field name="write_date"/>
160 <field name="date_open"/>
161 <field name="date_closed"/>
163 <group colspan="2" col="2">
164 <separator string="Mailings" colspan="2" col="2"/>
165 <field name="optin" on_change="on_change_optin(optin)"/>
166 <field name="optout" on_change="on_change_optout(optout)"/>
168 <group colspan="2" col="2">
169 <separator string="Statistics" colspan="2" col="2"/>
170 <field name="day_open"/>
171 <field name="day_close"/>
174 <page string="Communication & History" groups="base.group_extended">
176 <field colspan="4" name="email_cc" widget="char" size="512"/>
178 <field name="message_ids" colspan="4" nolabel="1" mode="tree,form" readonly="1">
179 <tree string="History">
180 <field name="display_text" string="History Information"/>
181 <field name="email_from" invisible="1"/>
183 string="Reply" attrs="{'invisible': [('email_from', '=', False)]}"
184 name="%(mail.action_email_compose_message_wizard)d"
185 context="{'mail.compose.message.mode':'reply', 'message_id':active_id}"
186 icon="terp-mail-replied" type="action" />
188 <form string="History">
189 <group col="4" colspan="4">
190 <group col="2" colspan="2" attrs="{'invisible': [('email_from', '=', False)]}">
191 <field name="email_from"/>
192 <field name="email_to" size="512"/>
194 <group col="2" colspan="2">
196 <field name="email_cc" size="512" attrs="{'invisible': [('email_from', '=', False)]}"/>
198 <field name="subject" colspan="4" widget="char" attrs="{'invisible': [('email_from', '=', False)]}" size="512"/>
199 <field name="display_text" colspan="4" attrs="{'invisible': [('email_from', '!=', False)]}"/>
201 <notebook colspan="4">
202 <page string="Details" attrs="{'invisible': [('email_from', '=', False)]}">
203 <field name="body_text" colspan="4" nolabel="1"/>
204 <group attrs="{'invisible': [('email_from', '=', False)]}">
205 <button colspan="4" string="Reply"
206 name="%(mail.action_email_compose_message_wizard)d"
207 context="{'mail.compose.message.mode':'reply'}"
208 icon="terp-mail-replied" type="action"/>
212 <page string="Attachments" attrs="{'invisible': [('email_from', '=', False)]}">
213 <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
218 <button string="Add Internal Note"
219 name="%(crm.action_crm_add_note)d"
220 context="{'model': 'crm.lead' }"
221 icon="terp-document-new" type="action" />
222 <button string="Send New Email"
223 name="%(mail.action_email_compose_message_wizard)d"
224 icon="terp-mail-message-new" type="action"/>
231 <!-- CRM Lead Tree View -->
233 <record model="ir.ui.view" id="crm_case_tree_view_leads">
234 <field name="name">Leads</field>
235 <field name="model">crm.lead</field>
236 <field name="type">tree</field>
237 <field name="arch" type="xml">
238 <tree string="Leads" colors="blue:state=='pending';grey:state in ('cancel', 'done')">
239 <field name="date_deadline" invisible="1"/>
240 <field name="create_date"/>
241 <field name="name" string="Subject"/>
242 <field name="contact_name"/>
243 <field name="country_id" invisible="context.get('invisible_country', True)" />
244 <field name="email_from"/>
245 <field name="phone"/>
247 <field name="categ_id" invisible="1"/>
248 <field name="type_id" invisible="1"/>
249 <field name="referred" invisible="1"/>
250 <field name="channel_id" invisible="1"/>
251 <field name="subjects" invisible="1"/>
253 <field name="stage_id"/>
254 <button name="stage_previous" string="Previous Stage"
255 states="open,pending" type="object" icon="gtk-go-back" />
256 <button name="stage_next" string="Next Stage"
257 states="open,pending" type="object"
258 icon="gtk-go-forward" />
259 <field name="section_id" invisible="context.get('invisible_section', True)" />
260 <field name="user_id" />
261 <field name="state" />
262 <button name="case_open" string="Open"
263 states="draft,pending" type="object"
264 icon="gtk-go-forward" />
265 <button name="case_close" string="Close"
266 states="open,draft,pending" type="object"
268 <button string="Convert to Opportunity"
269 name="convert_opportunity"
270 states="draft,open,pending" icon="gtk-go-forward"
272 <button name="case_escalate" string="Escalate"
273 states="open,draft,pending" type="object"
279 <!-- CRM Lead Calendar View -->
281 <record model="ir.ui.view" id="crm_case_calendar_view_leads">
282 <field name="name">CRM - Leads Calendar</field>
283 <field name="model">crm.lead</field>
284 <field name="type">calendar</field>
285 <field name="priority" eval="2"/>
286 <field name="arch" type="xml">
287 <calendar string="Leads Generation"
288 date_start="date_action" color="user_id">
289 <field name="name" />
290 <field name="partner_name" />
291 <field name="partner_address_id" />
296 <!-- CRM Lead Kanban View -->
297 <record model="ir.ui.view" id="crm_case_kanban_view_leads">
298 <field name="name">CRM - Leads Kanban</field>
299 <field name="model">crm.lead</field>
300 <field name="type">kanban</field>
301 <field name="arch" type="xml">
302 <kanban default_group_by="stage_id">
303 <field name="state"/>
304 <field name="color"/>
305 <field name="priority"/>
306 <field name="planned_revenue" sum="Expected Revenues"/>
307 <field name="user_email"/>
309 <t t-name="kanban-box">
310 <t t-set="color" t-value="kanban_color(record.color.raw_value)"/>
311 <div t-att-class="color + (record.priority.raw_value == 1 ? ' oe_kanban_color_alert' : '')">
312 <div class="oe_kanban_box oe_kanban_color_border">
313 <table class="oe_kanban_table oe_kanban_box_header oe_kanban_color_bgdark oe_kanban_color_border oe_kanban_draghandle">
315 <td class="oe_kanban_title3" align="left" valign="middle">
316 <a t-if="record.priority.raw_value == 1" icon="star-on" type="object" name="set_normal_priority"/>
317 <a t-if="record.priority.raw_value != 1" icon="star-off" type="object" name="set_high_priority" style="opacity:0.6; filter:alpha(opacity=60);"/>
318 <field name="partner_id"/>
320 <td class="oe_kanban_title2" align="right" valign="middle" t-if="record.planned_revenue.raw_value" nowrap="nowrap">
321 <t t-esc="Math.round(record.planned_revenue.value)"/> <field name="company_currency"/>
323 <td valign="top" width="22"><img t-att-src="kanban_gravatar(record.user_email.value, 22)" class="oe_kanban_gravatar"/></td>
327 <div class="oe_kanban_box_content oe_kanban_color_bglight oe_kanban_box_show_onclick_trigger">
328 <div class="oe_kanban_right oe_kanban_small">
329 <field name="user_login"/>
332 <b><field name="partner_address_name"/></b>
337 <div style="padding-left: 0.5em">
338 <i><field name="date_action"/><t t-if="record.date_action.raw_value"> : </t><field name="title_action"/></i>
342 <div class="oe_kanban_buttons_set oe_kanban_color_border oe_kanban_color_bglight oe_kanban_box_show_onclick">
343 <div class="oe_kanban_left">
344 <a string="Edit" icon="gtk-edit" type="edit"/>
345 <a string="Change Color" icon="color-picker" type="color" name="color"/>
346 <a string="Send New Email" name="%(mail.action_email_compose_message_wizard)d" icon="terp-mail-message-new" type="action"/>
347 <a string="Schedule/Log Call" name="%(opportunity2phonecall_act)d" icon="terp-call-start" type="action"/>
348 <a string="Add Internal Note" name="%(crm.action_crm_add_note)d" context="{'model': 'crm.lead' }" icon="terp-document-new" type="action"/>
349 <a string="Schedule Meeting" name="action_makeMeeting" type="object" icon="stock_calendar"/>
351 <div class="oe_kanban_right">
352 <a name="case_pending" string="Pending" states="draft,open" type="object" icon="kanban-pause" />
353 <a name="case_mark_won" string="Mark Won" states="open,pending" type="object" icon="kanban-apply" />
354 <a name="case_mark_lost" string="Mark Lost" states="open,pending" type="object" icon="kanban-stop" />
356 <br class="oe_kanban_clear"/>
366 <!-- CRM Lead Search View -->
368 <record id="view_crm_case_leads_filter" model="ir.ui.view">
369 <field name="name">CRM - Leads Search</field>
370 <field name="model">crm.lead</field>
371 <field name="type">search</field>
372 <field name="arch" type="xml">
373 <search string="Search Leads">
374 <filter icon="terp-check"
376 name="new" help="New Leads"
377 domain="[('state','=','draft')]"/>
378 <filter icon="terp-camera_test"
381 domain="[('state','=','open')]"/>
382 <filter icon="terp-gtk-media-pause"
385 domain="[('state','=','pending')]"/>
387 <separator orientation="vertical"/>
388 <filter icon="terp-go-today" string="Today"
389 domain="[('create_date','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]"
390 help="Todays' Leads" />
391 <filter icon="terp-go-week" string="7 Days"
392 help="Leads creating during last 7 days"
393 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'))]"
395 <separator orientation="vertical"/>
396 <field name="name" string="Lead / Customer"
397 filter_domain="['|','|',('partner_name','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
398 <field name="user_id">
399 <filter icon="terp-personal-"
400 domain="[('user_id','=', False)]"
401 help="Unassigned Leads" />
403 <field name="subjects" groups="base.group_extended"/>
404 <field name="section_id" widget="selection"
405 context="{'invisible_section': False}">
406 <filter icon="terp-personal+" groups="base.group_extended"
407 context="{'invisible_section': False}"
408 domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
409 help="My Sales Team(s)"/>
410 <filter icon="terp-personal+" groups="base.group_extended"
411 context="{'invisible_section': False}"
413 help="Show Sales Team"/>
415 <separator orientation="vertical"/>
416 <field name="country_id" context="{'invisible_country': False}">
417 <filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
420 <group expand="0" string="Group By...">
421 <filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
422 <filter string="Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
423 <filter string="Referrer" icon="terp-personal" domain="[]" context="{'group_by':'referred'}"/>
424 <separator orientation="vertical"/>
425 <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}"/>
426 <filter string="Campaign" icon="terp-gtk-jump-to-rtl"
427 domain="[]" context="{'group_by':'type_id'}" />
428 <filter string="Channel" icon="terp-call-start"
429 domain="[]" context="{'group_by':'channel_id'}" />
430 <separator orientation="vertical"/>
431 <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
432 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
433 <separator orientation="vertical"/>
434 <filter string="Creation" help="Create date" icon="terp-go-month"
435 domain="[]" context="{'group_by':'create_date'}" />
442 <!-- Opportunities Form View -->
443 <record model="ir.ui.view" id="crm_case_form_view_oppor">
444 <field name="name">Opportunities</field>
445 <field name="model">crm.lead</field>
446 <field name="type">form</field>
447 <field name="priority">10</field>
448 <field name="arch" type="xml">
449 <form string="Opportunities">
450 <group colspan="4" col="7">
451 <field name="name" required="1" string="Opportunity"/>
452 <label string="Stage:" align="1.0"/>
453 <group colspan="1" col="4">
454 <field name="stage_id" nolabel="1"
455 on_change="onchange_stage_id(stage_id)"
456 domain="[('section_ids', '=', section_id)]"/>
457 <button name="stage_previous"
458 states="draft,open,pending" type="object"
459 icon="gtk-go-back" string="" context="{'stage_type': 'opportunity'}"/>
460 <button name="stage_next" states="draft,open,pending"
461 type="object" icon="gtk-go-forward" string="" context="{'stage_type': 'opportunity'}"/>
463 <field name="user_id"/>
465 <button string="Schedule/Log Call"
466 name="%(opportunity2phonecall_act)d" icon="terp-call-start" type="action"/>
468 <field name="planned_revenue"/>
469 <field name="probability"/>
470 <field name="date_deadline"/>
472 <button name="action_makeMeeting" type="object"
473 string="Schedule Meeting" icon="gtk-redo" />
475 <field name="date_action"/>
476 <field name="title_action"/>
477 <field name="priority" string="Priority"/>
479 <field name="type" invisible="1"/>
481 <notebook colspan="4">
482 <page string="Opportunity">
483 <group col="4" colspan="2">
484 <separator colspan="4" string="Contacts"/>
486 <field name="partner_id" select="1"
487 on_change="onchange_partner_id(partner_id, email_from)" string="Customer"
489 <button name="%(action_crm_lead2partner)d"
490 icon="terp-partner" type="action"
492 attrs="{'invisible':[('partner_id','!=',False)]}"/>
494 <field name="partner_address_id"
496 on_change="onchange_partner_address_id(partner_address_id, email_from)"
498 <group col="3" colspan="2">
499 <field name="email_from" string="Email" />
500 <button string="Mail"
501 name="%(mail.action_email_compose_message_wizard)d"
502 context="{'mail':'new', 'model': 'crm.lead'}"
503 icon="terp-mail-message-new" type="action" />
505 <field name="phone"/>
508 <group col="2" colspan="2">
509 <separator colspan="2" string="Categorization"/>
510 <field name="section_id" colspan="1" widget="selection"/>
511 <field name="categ_id" select="1"
512 string="Category" widget="selection"
513 domain="[('object_id.model', '=', 'crm.lead')]" />
516 <separator colspan="4" string="Details"/>
517 <field name="description" nolabel="1" colspan="4"/>
519 <separator colspan="4"/>
520 <group col="10" colspan="4">
521 <field name="state" widget="statusbar" statusbar_visible="draft,open,done" statusbar_colors='{"pending":"blue"}'/>
522 <button name="case_cancel" string="Cancel" states="draft" type="object" icon="gtk-cancel" />
523 <button name="case_mark_lost" string="Mark Lost" states="open,pending" type="object" icon="gtk-cancel" />
524 <button name="case_reset" string="Reset to Draft" states="done,cancel" type="object" icon="gtk-convert" />
525 <button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward" />
526 <button name="case_pending" string="Pending" states="draft,open" type="object" icon="gtk-media-pause" />
527 <button name="case_escalate" string="Escalate" states="open,pending" type="object" groups="base.group_extended" icon="gtk-go-up" />
528 <button name="case_mark_won" string="Mark Won" states="open,pending" type="object" icon="gtk-apply" />
532 <group colspan="2" col="4">
533 <separator string="Contact" colspan="4" col="4"/>
534 <field name="partner_name" string="Customer Name" colspan="4"/>
536 <field domain="[('domain', '=', 'contact')]" name="title" widget="selection"/>
537 <field name="function" />
538 <field name="street" colspan="4"/>
539 <field name="street2" colspan="4"/>
542 <field name="country_id"/>
543 <field name="state_id"/>
545 <group colspan="2" col="2">
546 <separator string="Communication" colspan="2"/>
548 <field name="mobile"/>
550 <group colspan="2" col="2">
551 <separator string="Categorization" colspan="2"/>
552 <field name="type_id" widget="selection" groups="base.group_extended"/>
553 <field name="channel_id" widget="selection"/>
555 <group colspan="2" col="2">
556 <separator string="Mailings" colspan="2"/>
557 <field name="optin" on_change="on_change_optin(optin)"/>
558 <field name="optout" on_change="on_change_optout(optout)"/>
561 <page string="Communication & History" groups="base.group_extended">
563 <field colspan="4" name="email_cc" widget="char" size="512"/>
565 <field name="message_ids" colspan="4" nolabel="1" mode="tree,form" readonly="1">
566 <tree string="History">
567 <field name="display_text" string="History Information"/>
568 <field name="email_from" invisible="1"/>
570 string="Reply" attrs="{'invisible': [('email_from', '=', False)]}"
571 name="%(mail.action_email_compose_message_wizard)d"
572 context="{'mail.compose.message.mode':'reply', 'message_id':active_id}"
573 icon="terp-mail-replied" type="action" />
575 <form string="History">
576 <group col="4" colspan="4">
577 <group col="2" colspan="2" attrs="{'invisible': [('email_from', '=', False)]}">
578 <field name="email_from"/>
579 <field name="email_to" size="512"/>
581 <group col="2" colspan="2">
583 <field name="email_cc" size="512" attrs="{'invisible': [('email_from', '=', False)]}"/>
585 <field name="subject" colspan="4" widget="char" attrs="{'invisible': [('email_from', '=', False)]}" size="512"/>
586 <field name="display_text" colspan="4" attrs="{'invisible': [('email_from', '!=', False)]}"/>
588 <notebook colspan="4">
589 <page string="Details" attrs="{'invisible': [('email_from', '=', False)]}">
590 <field name="body_text" colspan="4" nolabel="1"/>
591 <group attrs="{'invisible': [('email_from', '=', False)]}">
592 <button colspan="4" string="Reply"
593 name="%(mail.action_email_compose_message_wizard)d"
594 context="{'mail.compose.message.mode':'reply'}"
595 icon="terp-mail-replied" type="action"/>
598 <page string="Attachments" attrs="{'invisible': [('email_from', '=', False)]}">
599 <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
604 <button string="Add Internal Note"
605 name="%(crm.action_crm_add_note)d"
606 context="{'model': 'crm.lead' }"
607 icon="terp-document-new" type="action" />
608 <button string="Send New Email"
609 name="%(mail.action_email_compose_message_wizard)d"
610 icon="terp-mail-message-new" type="action"/>
612 <page string="Extra Info" groups="base.group_extended">
613 <group col="2" colspan="2">
614 <separator string="Dates" colspan="2"/>
615 <field name="create_date"/>
616 <field name="write_date"/>
617 <field name="date_closed"/>
618 <field name="date_open"/>
620 <group col="2" colspan="2">
621 <separator string="Misc" colspan="2"/>
622 <field name="active"/>
623 <field name="day_open"/>
624 <field name="day_close"/>
625 <field name="referred"/>
627 <separator colspan="4" string="References"/>
636 <!-- Opportunities Tree View -->
637 <record model="ir.ui.view" id="crm_case_tree_view_oppor">
638 <field name="name">Opportunities Tree</field>
639 <field name="model">crm.lead</field>
640 <field name="type">tree</field>
641 <field name="arch" type="xml">
642 <tree string="Opportunities" colors="blue:state=='pending' and not(date_deadline and (date_deadline < current_date));gray:state in ('cancel', 'done');red:date_deadline and (date_deadline < current_date)">
643 <field name="date_deadline" invisible="1"/>
644 <field name="create_date"/>
645 <field name="name" string="Opportunity"/>
646 <field name="partner_id" string="Customer"/>
647 <field name="country_id" invisible="context.get('invisible_country', True)" />
648 <field name="date_action"/>
649 <field name="title_action" />
650 <field name="channel_id" invisible="1"/>
651 <field name="type_id" invisible="1"/>
652 <field name="subjects" invisible="1"/>
653 <field name="stage_id"/>
654 <button name="stage_previous" string="Previous Stage" states="open,pending" type="object" icon="gtk-go-back" />
655 <button name="stage_next" string="Next Stage" states="open,pending" type="object" icon="gtk-go-forward" />
656 <field name="planned_revenue" sum="Expected Revenues"/>
657 <field name="probability" widget="progressbar" avg="Avg. of Probability"/>
658 <field name="section_id" invisible="context.get('invisible_section', True)" />
659 <field name="user_id"/>
660 <field name="priority" invisible="1"/>
661 <field name="categ_id" invisible="1"/>
662 <field name="state"/>
663 <button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward" />
664 <button name="case_pending" string="Pending" states="open,draft" type="object" icon="gtk-media-pause" />
665 <button name="case_mark_lost" string="Lost" states="open,pending" type="object" icon="gtk-cancel" />
666 <button name="case_mark_won" string="Won" states="open,pending" type="object" icon="gtk-apply" />
672 <!-- Opportunities Search View -->
673 <record id="view_crm_case_opportunities_filter" model="ir.ui.view">
674 <field name="name">CRM - Opportunities Search</field>
675 <field name="model">crm.lead</field>
676 <field name="type">search</field>
677 <field name="arch" type="xml">
678 <search string="Search Opportunities">
679 <filter icon="terp-check"
680 string="New" help="New Opportunities"
682 domain="[('state','=','draft')]"/>
683 <filter icon="terp-camera_test"
684 string="Open" help="Open Opportunities"
686 domain="[('state','=','open')]"/>
687 <filter icon="terp-gtk-media-pause"
688 string="Pending" help="Pending Opportunities"
690 domain="[('state','=','pending')]"/>
691 <separator orientation="vertical"/>
692 <field name="name" string="Opportunity / Customer" filter_domain="['|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self)]"/>
693 <field name="partner_id" string="Customer / Email" filter_domain="['|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self)]"/>
694 <field name="user_id">
695 <filter icon="terp-personal-"
696 domain="[('user_id','=', False)]"
697 help="Unassigned Opportunities" />
699 <field name="section_id"
700 context="{'invisible_section': False}"
702 <filter icon="terp-personal+" groups="base.group_extended"
703 domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
704 context="{'invisible_section': False}"
705 help="My Sales Team(s)" />
706 <filter icon="terp-personal+" groups="base.group_extended"
707 context="{'invisible_section': False}"
709 help="Show Sales Team"/>
713 <group expand="0" string="Group By..." colspan="16">
714 <filter string="Salesman" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}" />
715 <filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
716 <filter string="Customer" help="Partner" icon="terp-personal+" domain="[]" context="{'group_by':'partner_id'}"/>
717 <separator orientation="vertical" />
718 <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}" />
719 <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}" />
720 <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}" />
721 <filter string="Campaign" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'type_id'}" groups="base.group_extended"/>
722 <filter string="Channel" icon="terp-call-start" domain="[]" context="{'group_by':'channel_id'}" />
723 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
724 <separator orientation="vertical" />
725 <filter string="Creation" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" />
726 <filter string="Exp.Closing" icon="terp-go-month" help="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}" />
732 <!-- crm.lead Opportunities Graph View -->
733 <record model="ir.ui.view" id="crm_case_graph_view_opportunity">
734 <field name="name">CRM - Opportunity Graph</field>
735 <field name="model">crm.lead</field>
736 <field name="type">graph</field>
737 <field name="arch" type="xml">
738 <graph string="Opportunity by Categories" type="bar" orientation="horizontal">
739 <field name="categ_id"/>
740 <field name="planned_revenue" operator="+"/>
741 <field name="state" group="True"/>