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