Launchpad automatic translations update.
[odoo/odoo.git] / addons / crm / crm_lead_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5         <!--
6             CRM CASE STAGE
7         -->
8
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"/>
16                     <field name="state"/>
17                     <field name="type"/>
18                 </search>
19             </field>
20         </record>
21
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.
31               </p><p>
32                 Stages will allow salespersons to easily track how a specific
33                 lead or opportunity is positioned in the sales cycle.
34               </p>
35             </field>
36         </record>
37
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"/>
39
40         <!--
41             LEADS/OPPORTUNITIES CATEGORIES
42         -->
43
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.
55               </p><p>
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.
60               </p>
61             </field>
62         </record>
63
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"/>
67
68         <!--
69             LEADS
70         -->
71         <act_window
72                 id="act_crm_opportunity_crm_phonecall_new"
73                 name="Phone calls"
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}"
78                 view_type="form"/>
79
80         <act_window
81                 id="act_crm_opportunity_crm_meeting_new"
82                 name="Meetings"
83                 res_model="crm.meeting"
84                 view_mode="tree,form,calendar"
85                 context="{'default_duration': 4.0, 'default_opportunity_id': active_id}"
86                 view_type="form"/>
87
88
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">
95                 <header>
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"
99                             states="cancel"/>
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="['&amp;', '|', ('case_default', '=', True), ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"
104                             on_change="onchange_stage_id(stage_id)"/>
105                 </header>
106                 <sheet>
107                     <div class="oe_right oe_button_box" name="buttons">
108                         <button string="Schedule/Log Call" 
109                                 name="%(opportunity2phonecall_act)d"
110                                 type="action"/>
111                     </div>
112                     <div class="oe_title">
113                         <label for="name" class="oe_edit_only"/>
114                         <h1><field name="name" placeholder="Describe the lead..."/></h1>
115                     </div>
116                     <group>
117                         <group>
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"/>
125                             <div>
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%%"/>
132                                 </div>
133                                 <field name="country_id" placeholder="Country" options='{"no_open": True}'/>
134                             </div>
135                         </group>
136                         <group>
137                             <label for="contact_name"/>
138                             <div>
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}'/>
141                             </div>
142                             <field name="email_from" widget="email"/>
143                             <field name="function"/>
144                             <field name="phone"/>
145                             <field name="mobile"/>
146                             <field name="fax"/>
147                             <!--
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"/>
152                             -->
153                         </group>
154                         <group>
155                             <field name="user_id" on_change="on_change_user(user_id, context)"
156                                 context="{'default_groups_ref': ['base.group_user', 'base.group_sale_salesman_all_leads'] }"/>
157                             <label for="section_id" groups="base.group_multi_salesteams"/>
158                             <div groups="base.group_multi_salesteams">
159                                 <field name="section_id"/>
160                                 <button name="case_escalate" string="Escalate"
161                                         type="object" class="oe_link"
162                                         attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
163                             </div>
164                             <field name="type" invisible="1"/>
165                         </group>
166                         <group>
167                             <field name="priority"/>
168                             <field name="categ_ids"
169                                 widget="many2many_tags"
170                                 domain="[('object_id.model','=','crm.lead')]"
171                                 context="{'object_name': 'crm.lead'}"
172                             />
173                         </group>
174                     </group>
175                     <notebook colspan="4">
176                     <page string="Internal Notes">
177                         <field name="description"/>
178                     </page>
179                     <page string="Extra Info">
180                         <group>
181                             <group string="Categorization" groups="base.group_multi_company,base.group_no_one" name="categorization">
182                                 <field name="company_id"
183                                     groups="base.group_multi_company"
184                                     widget="selection" colspan="2"/>
185                                 <field name="state" groups="base.group_no_one"/>
186                             </group>
187                             <group string="Mailings">
188                                 <field name="opt_out"/>
189                             </group>
190                             <group string="Misc">
191                                 <field name="active"/>
192                                 <field name="referred"/>
193                             </group>
194                         </group>
195                     </page>
196                     </notebook>
197                 </sheet>
198                 <div class="oe_chatter">
199                     <field name="message_follower_ids" widget="mail_followers"/>
200                     <field name="message_ids" widget="mail_thread"/>
201                 </div>
202             </form>
203         </field>
204         </record>
205
206         <!-- CRM Lead Graph View -->
207         <record model="ir.ui.view" id="crm_case_graph_view_leads">
208             <field name="name">Opportunities</field>
209             <field name="model">crm.lead</field>
210             <field name="arch" type="xml">
211                 <graph string="Opportunities" type="bar">
212                     <field name="stage_id"/>
213                     <field name="planned_revenue" operator="+"/>
214                 </graph>
215             </field>
216         </record>
217
218         <!-- CRM Lead Tree View -->
219         <record model="ir.ui.view" id="crm_case_tree_view_leads">
220             <field name="name">Leads</field>
221             <field name="model">crm.lead</field>
222             <field name="arch" type="xml">
223                 <tree string="Leads" fonts="bold:message_unread==True" colors="grey:state in ('cancel', 'done')">
224                     <field name="date_deadline" invisible="1"/>
225                     <field name="create_date"/>
226                     <field name="name"/>
227                     <field name="contact_name"/>
228                     <field name="country_id" invisible="context.get('invisible_country', True)"/>
229                     <field name="email_from"/>
230                     <field name="phone"/>
231                     <field name="stage_id"/>
232                     <field name="user_id" invisible="1"/>
233                     <field name="partner_id" invisible="1"/>
234                     <field name="section_id" invisible="context.get('invisible_section', True)" groups="base.group_multi_salesteams"/>
235                     <field name="state" invisible="1"/>
236                     <field name="type_id" invisible="1"/>
237                     <field name="referred" invisible="1"/>
238                     <field name="channel_id" invisible="1"/>
239                     <field name="message_unread" invisible="1"/>
240                 </tree>
241             </field>
242         </record>
243
244
245         <!-- CRM Lead Calendar View -->
246         <record model="ir.ui.view" id="crm_case_calendar_view_leads">
247             <field name="name">CRM - Leads Calendar</field>
248             <field name="model">crm.lead</field>
249             <field name="priority" eval="2"/>
250             <field name="arch" type="xml">
251                 <calendar string="Leads Generation"
252                     date_start="date_action" color="user_id">
253                     <field name="name"/>
254                     <field name="partner_name"/>
255                 </calendar>
256             </field>
257         </record>
258
259         <!-- CRM Lead Kanban View  -->
260         <record model="ir.ui.view" id="crm_case_kanban_view_leads">
261             <field name="name">CRM - Leads Kanban</field>
262             <field name="model">crm.lead</field>
263             <field name="arch" type="xml">
264                 <kanban default_group_by="stage_id">
265                     <field name="state" groups="base.group_no_one"/>
266                     <field name="stage_id"/>
267                     <field name="color"/>
268                     <field name="priority"/>
269                     <field name="planned_revenue" sum="Expected Revenues"/>
270                     <field name="user_email"/>
271                     <field name="user_id"/>
272                     <field name="partner_address_email"/>
273                     <field name="message_summary"/>
274                     <field name="message_unread"/>
275                     <templates>
276                         <field name="date_deadline"/>
277                         <t t-name="kanban-box">
278                             <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
279                                 <div class="oe_dropdown_toggle oe_dropdown_kanban">
280                                     <span class="oe_e">í</span>
281                                     <ul class="oe_dropdown_menu">
282                                         <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
283                                         <t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
284                                         <li><a name="%(mail.action_email_compose_message_wizard)d" type="action">Send Email</a></li>
285                                         <li><a name="%(opportunity2phonecall_act)d" type="action">Schedule/Log Call</a></li>
286                                         <li><a name="action_makeMeeting" type="object">Schedule Meeting</a></li>
287                                         <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
288                                     </ul>
289                                 </div>
290                                 <div class="oe_kanban_content">
291                                     <div>
292                                         <b><field name="name"/></b>
293                                         <t t-if="record.planned_revenue.raw_value">
294                                             - <b><t t-esc="record.planned_revenue.value"/>
295                                             <field name="company_currency"/></b>
296                                         </t>
297                                     </div>
298                                     <div>
299                                         <field name="partner_id"/>
300                                     </div>
301                                     <div style="padding-left: 0.5em">
302                                         <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>
303                                         <span t-attf-class="#{red || ''}"><field name="date_action"/></span>
304                                         <t t-if="record.date_action.raw_value"> : </t>
305                                         <field name="title_action"/>
306                                     </div>
307                                     <div class="oe_kanban_bottom_right">
308                                         <a t-if="record.priority.raw_value == 1" type="object" name="set_normal_priority" class="oe_e oe_star_on">7</a>
309                                         <a t-if="record.priority.raw_value != 1" type="object" name="set_high_priority" class="oe_e oe_star_off">7</a>
310                                         <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"/>
311                                     </div>
312                                     <div class="oe_kanban_footer_left">
313                                         <t t-raw="record.message_summary.raw_value"/>
314                                     </div>
315                                 </div>
316                                 <div class="oe_clear"></div>
317                             </div>
318                         </t>
319                     </templates>
320                 </kanban>
321             </field>
322         </record>
323
324         <!-- CRM Lead Search View -->
325         <record id="view_crm_case_leads_filter" model="ir.ui.view">
326             <field name="name">CRM - Leads Search</field>
327             <field name="model">crm.lead</field>
328             <field name="arch" type="xml">
329                 <search string="Search Leads">
330                     <field name="name" string="Lead / Customer" filter_domain="['|','|',('partner_name','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
331                     <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike',self)]"/>
332                     <field name="section_id" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/>
333                     <field name="user_id"/>
334                     <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
335                     <field name="create_date"/>
336                     <field name="country_id" context="{'invisible_country': False}"/>
337                     <separator/>
338                     <filter string="Open" name="open" domain="[('state','!=','cancel')]" help="Open Leads"/>
339                     <filter string="Dead" name="dead" domain="[('state','=','cancel')]"/>
340                     <filter string="Unassigned" name="unassigned" domain="[('user_id','=', False)]" help="No salesperson"/>
341                     <filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]" help="Unread messages"/>
342                     <filter string="Assigned to Me"
343                             domain="[('user_id','=',uid)]" context="{'invisible_section': False}"
344                             help="Leads that are assigned to me"/>
345                     <filter string="Assigned to My Team(s)"
346                             domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
347                             help="Leads that are assigned to any sales teams I am member of" groups="base.group_multi_salesteams"/>
348                     <separator />
349                     <filter string="Available for mass mailing"
350                             name='not_opt_out' domain="[('opt_out', '=', False)]"
351                             help="Leads that did not ask not to be included in mass mailing campaigns"/>
352                     <separator />
353                     <group expand="0" string="Group By...">
354                         <filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}"/>
355                         <filter string="Team" domain="[]" context="{'group_by':'section_id'}" groups="base.group_multi_salesteams"/>
356                         <filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
357                         <filter string="Customer" help="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
358                         <filter string="Country" domain="[]" context="{'group_by':'country_id'}"/>
359                         <filter string="Referrer" domain="[]" context="{'group_by':'referred'}"/>
360                         <filter string="Campaign" domain="[]" context="{'group_by':'type_id'}"/>
361                         <filter string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
362                         <filter string="Creation" domain="[]" context="{'group_by':'create_date'}"/>
363                     </group>
364                     <group string="Display">
365                         <filter string="Show Countries" context="{'invisible_country': False}" help="Show Countries"/>
366                         <filter string="Show Sales Team" context="{'invisible_section': False}" domain="[]" help="Show Sales Team" groups="base.group_multi_salesteams"/>
367                     </group>
368                 </search>
369             </field>
370         </record>
371
372
373         <!--
374             OPPORTUNITY
375         -->
376
377         <!-- Opportunities Form View -->
378         <record model="ir.ui.view" id="crm_case_form_view_oppor">
379             <field name="name">Opportunities</field>
380             <field name="model">crm.lead</field>
381             <field name="priority">20</field>
382             <field name="arch" type="xml">
383                 <form string="Opportunities" version="7.0">
384                     <header>
385                         <button name="case_mark_won" string="Mark Won" type="object"
386                                 states="draft,open,pending" class="oe_highlight"/>
387                         <button name="case_mark_lost" string="Mark Lost" type="object"
388                                 states="draft,open" class="oe_highlight"/>
389                         <field name="stage_id" widget="statusbar" clickable="True"/>
390                     </header>
391                     <sheet>
392                         <div class="oe_right oe_button_box">
393                             <button string="Schedule/Log Call"
394                                 name="%(opportunity2phonecall_act)d"
395                                 type="action"/>
396                             <button string="Meeting"
397                                 name="action_makeMeeting"
398                                 type="object"
399                                 context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}"/>
400                         </div>
401                         <div class="oe_title">
402                             <label for="name" class="oe_edit_only"/>
403                             <h1><field name="name"/></h1>
404                             <label for="planned_revenue" class="oe_edit_only"/>
405                             <h2>
406                                 <field name="company_currency" invisible="1"/>
407                                 <field name="planned_revenue" class="oe_inline" widget='monetary' options="{'currency_field': 'company_currency'}"/>
408                                 <span class="oe_grey"> at </span>
409                                 <field name="probability" class="oe_inline" widget="integer"/>%%
410                             </h2>
411                         </div>
412                         <group>
413                             <group>
414                                 <field name="partner_id"
415                                     on_change="onchange_partner_id(partner_id, email_from)"
416                                     string="Customer"
417                                     context="{'default_name': partner_name, 'default_email': email_from, 'default_phone': phone}"/>
418                                 <field name="email_from" string="Email"/>
419                                 <field name="phone"/>
420                             </group>
421
422                             <group>
423                                 <label for="title_action"/>
424                                 <div>
425                                     <field name="date_action" nolabel="1"/> <label string="-" attrs="{'invisible': ['|', ('date_action', '=', False), ('title_action', '=', False)]}"/>
426                                     <field name="title_action" class="oe_inline" nolabel="1" placeholder="e.g. Call for proposal"/>
427                                 </div>
428                                 <field name="date_deadline"/>
429                                 <field name="priority"/>
430                             </group>
431
432                             <group>
433                                 <field name="user_id" on_change="on_change_user(user_id, context)" context="{'default_groups_ref': ['base.group_user', 'base.group_sale_salesman_all_leads']}"/>
434                                 <label for="section_id" groups="base.group_multi_salesteams"/>
435                                 <div groups="base.group_multi_salesteams">
436                                     <field name="section_id" widget="selection"/>
437                                     <button name="case_escalate" string="Escalate" type="object" class="oe_link" attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
438                                 </div>
439                             </group>
440                             <group>
441                                 <field name="categ_ids"
442                                     string="Categories" widget="many2many_tags"
443                                     context="{'object_name': 'crm.lead'}"
444                                     domain="[('object_id.model', '=', 'crm.lead')]"/>
445
446                             </group>
447                         </group>
448
449                         <notebook colspan="4">
450                         <page string="Internal Notes">
451                             <field name="description"/>
452                         </page>
453                         <page string="Lead">
454                             <group>
455                                 <group>
456                                     <field name="partner_name"/>
457                                     <label for="street" string="Address"/>
458                                     <div>
459                                         <field name="street" placeholder="Street..."/>
460                                         <field name="street2"/>
461                                         <div class="address_format">
462                                             <field name="city" placeholder="City" style="width: 40%%"/>
463                                             <field name="state_id" options='{"no_open": True}' on_change="onchange_state(state_id)" placeholder="State" style="width: 24%%"/>
464                                             <field name="zip" placeholder="ZIP" style="width: 34%%"/>
465                                         </div>
466                                         <field name="country_id" placeholder="Country" options='{"no_open": True}'/>
467                                     </div>
468                                 </group>
469
470                                 <group>
471                                     <label for="contact_name"/>
472                                     <div>
473                                         <field name="contact_name" class="oe_inline"/>
474                                         <field name="title" placeholder="Title" domain="[('domain', '=', 'contact')]" options='{"no_open": True}' class="oe_inline"/>
475                                     </div>
476                                     <field name="function"/>
477                                     <field name="mobile"/>
478                                     <field name="fax"/>
479                                 </group>
480                                 <group string="Mailings" name="mailings">
481                                     <field name="opt_out"/>
482                                 </group>
483                                 <group string="Misc">
484                                     <field name="active"/>
485                                     <field name="day_open" groups="base.group_no_one"/>
486                                     <field name="day_close" groups="base.group_no_one"/>
487                                     <field name="referred"/>
488                                     <field name="state" invisible="1"/>
489                                     <field name="type" invisible="1"/>
490                                 </group>
491                                 <group string="References">
492                                     <field name="ref"/>
493                                     <field name="ref2"/>
494                                 </group>
495                             </group>
496                         </page>
497                         <page string="Fund Raising" groups="crm.group_fund_raising">
498                             <group>
499                                 <field name="payment_mode" widget="selection"/>
500                                 <field name="planned_cost"/>
501                             </group>
502                         </page>
503                         </notebook>
504                     </sheet>
505                     <div class="oe_chatter">
506                         <field name="message_follower_ids" widget="mail_followers"/>
507                         <field name="message_ids" widget="mail_thread"/>
508                     </div>
509                 </form>
510             </field>
511         </record>
512
513         <!-- Opportunities Tree View -->
514         <record model="ir.ui.view" id="crm_case_tree_view_oppor">
515             <field name="name">Opportunities Tree</field>
516             <field name="model">crm.lead</field>
517             <field name="arch" type="xml">
518                 <tree string="Opportunities" fonts="bold:message_unread==True" colors="gray:state in ('cancel', 'done');red:date_deadline and (date_deadline &lt; current_date)">
519                     <field name="date_deadline" invisible="1"/>
520                     <field name="create_date"/>
521                     <field name="name" string="Opportunity"/>
522                     <field name="partner_id" string="Customer"/>
523                     <field name="country_id" invisible="context.get('invisible_country', True)"/>
524                     <field name="date_action"/>
525                     <field name="title_action"/>
526                     <field name="channel_id" invisible="1"/>
527                     <field name="type_id" invisible="1"/>
528                     <field name="stage_id"/>
529                     <field name="planned_revenue" sum="Expected Revenues"/>
530                     <field name="probability" avg="Avg. of Probability"/>
531                     <field name="section_id" invisible="context.get('invisible_section', True)" groups="base.group_multi_salesteams"/>
532                     <field name="user_id"/>
533                     <field name="referred" invisible="1"/>
534                     <field name="priority" invisible="1"/>
535                     <field name="message_unread" invisible="1"/>
536                     <field name="state" invisible="1"/>
537                 </tree>
538             </field>
539         </record>
540
541
542         <!-- Opportunities Search View -->
543         <record id="view_crm_case_opportunities_filter" model="ir.ui.view">
544             <field name="name">CRM - Opportunities Search</field>
545             <field name="model">crm.lead</field>
546             <field name="arch" type="xml">
547                 <search string="Search Opportunities">
548                     <field name="name" string="Opportunity" filter_domain="['|','|','|',('partner_id','ilike',self),('partner_name','ilike',self),('email_from','ilike',self),('name', 'ilike', self)]"/>
549                     <field name="categ_ids" string="Category" filter_domain="[('categ_ids','ilike', self)]"/>
550                     <field name="section_id" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/>
551                     <field name="user_id"/>
552                     <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
553                     <separator/>
554                     <filter string="New" name="new" domain="[('state','=','draft')]" help="New Opportunities"/>
555                     <filter string="In Progress" name="open" domain="[('state','=','open')]" help="Open Opportunities"/>
556                     <filter string="Won" name="won" domain="[('state','=','done')]"/>
557                     <filter string="Lost" name="lost" domain="[('state','=','cancel')]"/>
558                     <filter string="Unassigned" name="unassigned" domain="[('user_id','=', False)]" help="No salesperson"/>
559                     <filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]" help="Unread messages"/>
560                     <filter string="My Opportunities" name="assigned_to_me"
561                             domain="[('user_id','=',uid)]" context="{'invisible_section': False}"
562                             help="Opportunities that are assigned to me"/>
563                     <filter string="Assigned to My Team(s)"
564                             domain="[('section_id.member_ids', 'in', [uid])]" context="{'invisible_section': False}"
565                             help="Opportunities that are assigned to any sales teams I am member of"/>
566                     <separator/>
567                     <group expand="0" string="Group By..." colspan="16">
568                         <filter string="Salesperson" domain="[]" context="{'group_by':'user_id'}"/>
569                         <filter string="Team" domain="[]" context="{'group_by':'section_id'}"/>
570                         <filter string="Stage" domain="[]" context="{'group_by':'stage_id'}"/>
571                         <filter string="Customer" help="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
572                         <filter string="Country" domain="[]" context="{'group_by':'country_id'}"/>
573                         <filter string="Priority" domain="[]" context="{'group_by':'priority'}"/>
574                         <filter string="Expected Closing" domain="[]" context="{'group_by':'date_deadline'}"/>
575                         <filter string="Referrer" domain="[]" context="{'group_by':'referred'}"/>
576                         <filter string="Campaign" domain="[]" context="{'group_by':'type_id'}"/>
577                         <filter string="Channel" domain="[]" context="{'group_by':'channel_id'}"/>
578                         <filter string="Creation" domain="[]" context="{'group_by':'create_date'}"/>
579                     </group>
580                     <group string="Display">
581                         <filter string="Show Sales Team" context="{'invisible_section': False}" domain="[]" help="Show Sales Team" groups="base.group_multi_salesteams"/>
582                         <filter string="Show Countries" context="{'invisible_country': False}" help="Show Countries"/>
583                     </group>
584                 </search>
585             </field>
586         </record>
587
588         <!--
589             MASS MAILING
590         -->
591         <act_window name="Lead/Opportunity Mass Mail"
592                 res_model="mail.compose.message"
593                 src_model="crm.lead"
594                 view_mode="form"
595                 multi="True"
596                 target="new"
597                 key2="client_action_multi"
598                 id="crm.action_lead_mass_mail"
599                 context="{
600                             'default_composition_mode': 'mass_mail',
601                             'default_email_to':'{$object.email or \'\'}',
602                             'default_use_template': True,
603                             'default_template_id': ref('crm.email_template_opportunity_mail'),
604                         }"
605                 groups="base.group_sale_salesman"
606                 />
607
608         <!--Update of email_template defined in crm_lead_data, to add ref_ir_act_window
609             allowing to have a well formed email template (context action considered as set). -->
610         <record id="email_template_opportunity_mail" model="email.template">
611             <field name="ref_ir_act_window" ref="crm.action_lead_mass_mail"/>
612         </record>
613
614         <record id="action_mark_as_lost" model="ir.actions.server">
615             <field name="name">Mark As Lost</field>
616             <field name="model_id" ref="model_crm_lead"/>
617             <field name="state">code</field>
618             <field name="code">
619                 if context.get('active_model') == 'crm.lead' and context.get('active_ids'):
620                     self.case_cancel(cr, uid, context['active_ids'], context=context)
621             </field>
622             <field name="groups_id" eval="[(4,ref('base.group_sale_salesman'))]"/>
623         </record>
624
625         <record id="ir_mark_as_lost" model="ir.values">
626             <field eval="'client_action_multi'" name="key2"/>
627             <field eval="'crm.lead'" name="model"/>
628             <field name="name">Mark As Lost</field>
629             <field eval="'ir.actions.server,%d'%action_mark_as_lost" name="value"/>
630         </record>
631
632     </data>
633 </openerp>