Launchpad automatic translations update.
[odoo/odoo.git] / addons / crm / crm_opportunity_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4     
5     <record id="crm_opportunity_stage_act" model="ir.actions.act_window">
6         <field name="name">Stages</field>
7         <field name="res_model">crm.case.stage</field>
8         <field name="view_type">form</field>
9         <field name="view_id" ref="crm.crm_case_stage_tree"/>
10         <field name="domain">[('type', '=', 'opportunity')]</field>
11         <field name="context">{'type':'opportunity'}</field>
12         <field name="help">Create specific stages that will help your sales better organise their sales pipeline by maintaining them to their sales opportunities. It will allow them to easily track how is positioned a specific opportunity in the sales cycle.</field>
13     </record>
14     
15
16
17      <menuitem action="crm_opportunity_stage_act" id="menu_crm_opportunity_stage_act" name="Stages"
18         groups="base.group_extended" sequence="0"
19         parent="base.menu_crm_config_opportunity" />
20         
21         <!-- Opportunities Form View -->
22             <record model="ir.ui.view" id="crm_case_form_view_oppor">
23                 <field name="name">Opportunities</field>
24                 <field name="model">crm.lead</field>
25                 <field name="type">form</field>
26                 <field name="priority">10</field>
27                 <field name="arch" type="xml">
28                     <form string="Opportunities">
29                         <group colspan="4" col="7">
30                             <field name="name"  required="1" string="Opportunity"/>
31                             <label string="Stage:" align="1.0"/>
32                             <group colspan="1" col="4">
33                                 <field name="stage_id" nolabel="1"
34                                     on_change="onchange_stage_id(stage_id)"
35                                     domain="[('type','=','opportunity'),('section_ids', '=', section_id)]"/>
36                                 <button name="stage_previous"
37                                     states="draft,open,pending" type="object"
38                                     icon="gtk-go-back" string="" />
39                                 <button name="stage_next" states="draft,open,pending"
40                                     type="object" icon="gtk-go-forward" string="" context="{'stage_type': 'opportunity'}"/>
41                             </group>
42                             <field name="user_id"/>
43
44                             <button string="Schedule/Log Call"
45                             name="%(opportunity2phonecall_act)d" icon="terp-call-start" type="action" groups="base.group_extended"/>
46
47                             <field name="planned_revenue"/>
48                             <field name="probability"/>
49                             <field name="date_deadline"/>
50
51                             <button name="action_makeMeeting" type="object"
52                             string="Schedule Meeting" icon="gtk-redo" />
53                             <newline/>
54                             <field name="date_action"/>
55                             <field name="title_action"/>
56                             <field name="priority" string="Priority"/>
57                             <newline/>
58                             <field name="type" invisible="1"/>
59                         </group>
60                         <notebook colspan="4">
61                         <page string="Opportunity">
62                             <group col="4" colspan="2">
63                                 <separator colspan="4" string="Contacts"/>
64                                 <group colspan="2">
65                                     <field name="partner_id" select="1"
66                                         on_change="onchange_partner_id(partner_id, email_from)" string="Customer"
67                                         colspan="2" />
68                                     <button name="%(action_crm_lead2partner)d"
69                                         icon="terp-partner" type="action"
70                                         string="Create"
71                                         attrs="{'invisible':[('partner_id','!=',False)]}"/>
72                                 </group>
73                                 <field name="partner_address_id"
74                                     string="Contact"
75                                     on_change="onchange_partner_address_id(partner_address_id, email_from)"
76                                     colspan="1" />
77                                 <field name="email_from" string="Email" />
78                                 <field name="phone"/>
79                             </group>
80                             <group col="2" colspan="2">
81                                 <separator colspan="2" string="Categorization"/>
82                                 <field name="section_id" colspan="1" widget="selection"/>
83                                 <field name="categ_id" select="1"
84                                 string="Category" widget="selection"
85                                 domain="[('object_id.model', '=', 'crm.lead')]" />
86                             </group>
87
88                             <separator colspan="4" string="Details"/>
89                             <field name="description" nolabel="1" colspan="4"/>
90
91                             <separator colspan="4"/>
92                             <group col="10" colspan="4">
93                                 <field name="state"/>
94                                 <button name="case_cancel" string="Cancel"
95                                     states="draft" type="object"
96                                     icon="gtk-cancel" />
97                                 <button name="case_mark_lost" string="Mark Lost"
98                                     states="open,pending" type="object"
99                                     icon="gtk-cancel" />
100                                 <button name="case_reset" string="Reset to Draft"
101                                     states="done,cancel" type="object"
102                                     icon="gtk-convert" />
103                                 <button name="case_open" string="Open"
104                                     states="draft,pending" type="object"
105                                     icon="gtk-go-forward" />
106                                 <button name="case_pending" string="Pending"
107                                     states="draft,open" type="object"
108                                     icon="gtk-media-pause" />
109                                 <button name="case_escalate" string="Escalate"
110                                     states="open,pending" type="object"
111                                     groups="base.group_extended"
112                                     icon="gtk-go-up" />
113                                 <button name="case_close" string="Mark Won"
114                                     states="open,pending" type="object"
115                                     icon="gtk-apply" />
116                             </group>
117                         </page>
118                         <page string="Lead">
119                             <group colspan="2" col="4">
120                                 <separator string="Contact" colspan="4" col="4"/>
121                                 <field name="partner_name" string="Customer Name" colspan="4"/>
122                                 <newline/>
123                                 <field domain="[('domain', '=', 'contact')]" name="title" widget="selection"/>
124                                 <field name="function" />
125                                 <field name="street" colspan="4"/>
126                                 <field name="street2" colspan="4"/>
127                                 <field name="zip"/>
128                                 <field name="city"/>
129                                 <field name="country_id"/>
130                                 <field name="state_id"/>
131                             </group>
132                             <group colspan="2" col="2">
133                                 <separator string="Communication" colspan="2"/>
134                                 <field name="fax"/>
135                                 <field name="mobile"/>
136                             </group>
137                             <group colspan="2" col="2">
138                                 <separator string="Categorization" colspan="2"/>
139                                 <field name="type_id" widget="selection" groups="base.group_extended"/>
140                                 <field name="channel_id" widget="selection"/>
141                             </group>
142                             <group colspan="2" col="2">
143                                 <separator string="Mailings" colspan="2"/>
144                                 <field name="optin"/>
145                                 <field name="optout"/>
146                             </group>
147                         </page>
148
149                         <page string="Communication &amp; History" groups="base.group_extended">
150                             <group colspan="4">
151                                 <field colspan="4" name="email_cc" string="Global CC" widget="char" size="512"/>
152                             </group>
153                             <field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
154                                 <tree string="History">
155                                     <field name="display_text" string="History Information"/>
156                                     <field name="history" invisible="1"/>
157                                     <button
158                                         string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
159                                         name="%(crm.action_crm_send_mail)d"
160                                         context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
161                                         icon="terp-mail-replied" type="action" />
162                                 </tree>
163                                 <form string="History">
164                                     <group col="4" colspan="4">
165                                         <field name="email_from"/>
166                                         <field name="date"/>
167                                         <field name="email_to" size="512"/>
168                                         <field name="email_cc" size="512"/>
169                                         <field name="name" colspan="4"/>
170                                         <field name="history" invisible="1"/>
171                                     </group>
172                                     <notebook colspan="4">
173                                         <page string="Details">
174                                             <group attrs="{'invisible': [('history', '!=', True)]}">
175                                                 <field name="description" colspan="4" nolabel="1" height="250"/>
176                                                 <button colspan="4"
177                                                     string="Reply"
178                                                     name="%(crm.action_crm_send_mail)d"
179                                                     context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
180                                                     icon="terp-mail-replied" type="action" />
181                                             </group>
182                                             <group attrs="{'invisible': [('history', '=', True)]}">
183                                                 <field name="display_text" colspan="4" nolabel="1"  height="250"/>
184                                             </group>
185                                         </page>
186                                         <page string="Attachments">
187                                             <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
188                                         </page>
189                                     </notebook>
190                                 </form>
191                             </field>
192                             <button string="Add Internal Note"
193                                 name="%(crm.action_crm_add_note)d"
194                                 context="{'model': 'crm.lead' }"
195                                 icon="terp-document-new" type="action" />
196                             <button string="Send New Email"
197                                 name="%(crm.action_crm_send_mail)d"
198                                 context="{'mail':'new', 'model': 'crm.lead'}"
199                                 icon="terp-mail-message-new" type="action" />
200                         </page>
201                         <page string="Extra Info" groups="base.group_extended">
202                             <group col="2" colspan="2">
203                                 <separator string="Dates" colspan="2"/>
204                                 <field name="create_date"/>
205                                 <field name="write_date"/>
206                                 <field name="date_closed"/>
207                                 <field name="date_open"/>
208                             </group>
209                             <group col="2" colspan="2">
210                                 <separator string="Misc" colspan="2"/>
211                                 <field name="active"/>
212                                 <field name="day_open"/>
213                                 <field name="day_close"/>
214                                 <field name="referred"/>
215                             </group>
216                             <separator colspan="4" string="References"/>
217                             <field name="ref"/>
218                             <field name="ref2"/>
219                         </page>
220                         </notebook>
221                     </form>
222                 </field>
223             </record>
224
225         <!-- Opportunities Tree View -->
226
227             <record model="ir.ui.view" id="crm_case_tree_view_oppor">
228                 <field name="name">Opportunities Tree</field>
229                 <field name="model">crm.lead</field>
230                 <field name="type">tree</field>
231                 <field name="arch" type="xml">
232                     <tree string="Opportunities" colors="blue:state=='pending' and not(date_deadline and (date_deadline &lt; current_date));gray:state in ('cancel', 'done');red:date_deadline and (date_deadline &lt; current_date)">
233                         <field name="date_deadline" invisible="1"/>
234                         <field name="create_date"/>
235                         <field name="name" string="Opportunity"/>
236                         <field name="partner_id" string="Customer"/>
237                         <field name="country_id" invisible="context.get('invisible_country', True)" />
238                         <field name="date_action"/>
239                         <field name="title_action" />
240                         <field name="stage_id"/>
241                         <field name="channel_id" invisible="1"/>
242                         <field name="type_id" invisible="1"/>
243                         <button name="stage_previous" string="Previous Stage"
244                             states="open,pending" type="object" icon="gtk-go-back" />
245                         <button name="stage_next" string="Next Stage"
246                             states="open,pending" type="object"
247                             icon="gtk-go-forward" />
248                         <field name="planned_revenue" sum="Expected Revenues"/>
249                         <field name="probability" widget="progressbar" avg="Avg. of Probability"/>
250                         <field name="section_id"
251                             invisible="context.get('invisible_section', True)" />
252                         <field name="user_id"/>
253                         <field name="priority" invisible="1"/>
254                         <field name="categ_id" invisible="1"/>
255                         <field name="state"/>
256                         <button name="case_open" string="Open"
257                             states="draft,pending" type="object"
258                             icon="gtk-go-forward" />
259                         <button name="case_pending" string="Pending"
260                             states="open,draft" type="object"
261                             icon="gtk-media-pause" />
262                         <button name="case_close" string="Won"
263                             states="open,draft,pending" type="object"
264                             icon="gtk-apply" />
265                     </tree>
266                 </field>
267             </record>
268
269         <!-- Opportunities Graph View -->
270
271             <record model="ir.ui.view" id="crm_case_graph_view_opportunity">
272                 <field name="name">CRM - Opportunity Graph</field>
273                 <field name="model">crm.lead</field>
274                 <field name="type">graph</field>
275                 <field name="arch" type="xml">
276                     <graph string="Opportunity by Categories" type="bar" orientation="horizontal">
277                         <field name="categ_id"/>
278                         <field name="planned_revenue" operator="+"/>
279                         <field name="state" group="True"/>
280                     </graph>
281                 </field>
282             </record>
283
284         <!-- Opportunities Search View -->
285
286             <record id="view_crm_case_opportunities_filter" model="ir.ui.view">
287                 <field name="name">CRM - Opportunities Search</field>
288                 <field name="model">crm.lead</field>
289                 <field name="type">search</field>
290                 <field name="arch" type="xml">
291                     <search string="Search Opportunities">
292                         <filter icon="terp-check"
293                             string="Current"  help="Draft and Open Opportunities"
294                             name="current"
295                             domain="[('state','in',('draft','open'))]"/>
296                         <filter icon="terp-camera_test"
297                             string="Open"  help="Open Opportunities"
298                             domain="[('state','=','open')]"/>
299                         <filter icon="terp-gtk-media-pause"
300                             string="Pending"  help="Pending Opportunities"
301                             domain="[('state','=','pending')]"/>
302                         <separator orientation="vertical"/>
303                         <field name="name" string="Opportunity"/>
304                         <field name="partner_id" string="Customer"/>
305                         <field name="user_id">
306                             <filter icon="terp-personal-"
307                                 domain="[('user_id','=', False)]"
308                                 help="Unassigned Opportunities" />
309                         </field>
310                         <field name="section_id"
311                             context="{'invisible_section': False}"
312                             widget="selection">
313                             <filter icon="terp-personal+" groups="base.group_extended"
314                                 domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
315                                 context="{'invisible_section': False}"
316                                 help="My Sales Team(s)" />
317                             <filter icon="terp-personal+" groups="base.group_extended"
318                                 context="{'invisible_section': False}"
319                                 domain="[]"
320                                 help="Show Sales Team"/>
321                         </field>
322                         <newline/>
323                         <group  expand="0" string="Extended Filters..." groups="base.group_extended">
324                               <field name="stage_id" widget="selection" domain="[('type', '=', 'opportunity')]"/>
325                               <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
326                               <separator orientation="vertical"/>
327                               <field name="country_id" context="{'invisible_country': False}">
328                                   <filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
329                               </field>
330                               <separator orientation="vertical"/>
331                               <field name="email_from"/>
332                               <separator orientation="vertical"/>
333                               <field name="company_id" widget="selection" groups="base.group_multi_company"/>
334                               <newline/>
335                               <field name="create_date" string="Creation Date"/>
336                               <field name="date_closed"/>
337                         </group>
338                         <newline/>
339                         <group expand="0" string="Group By..." colspan="16">
340                             <filter string="Salesman" icon="terp-personal"
341                                 domain="[]" context="{'group_by':'user_id'}" />
342                             <filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
343                             <separator orientation="vertical" />
344                             <filter string="Stage" icon="terp-stage" domain="[]"
345                                 context="{'group_by':'stage_id'}" />
346                             <filter string="Priority" icon="terp-rating-rated" domain="[]"
347                                 context="{'group_by':'priority'}" />
348                             <filter string="Category" icon="terp-stock_symbol-selection"
349                                 domain="[]" context="{'group_by':'categ_id'}" />
350                             <filter string="Campaign" icon="terp-gtk-jump-to-rtl"
351                                 domain="[]" context="{'group_by':'type_id'}" groups="base.group_extended"/>
352                             <filter string="Channel" icon="terp-call-start"
353                                 domain="[]" context="{'group_by':'channel_id'}" />
354                             <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
355                             <separator orientation="vertical" />
356                             <filter string="Creation" icon="terp-go-month"
357                                 domain="[]" context="{'group_by':'create_date'}" />
358                             <filter string="Exp.Closing"
359                                 icon="terp-go-month"
360                                 help="Expected Closing" domain="[]"
361                                 context="{'group_by':'date_deadline'}" />
362                         </group>
363                     </search>
364                 </field>
365             </record>
366
367
368         <!-- Opportunities Graph View -->
369
370             <record model="ir.ui.view" id="crm_case_graph_view_opportunity">
371                 <field name="name">CRM - Opportunity Graph</field>
372                 <field name="model">crm.lead</field>
373                 <field name="type">graph</field>
374                 <field name="arch" type="xml">
375                     <graph string="Opportunity by Categories" type="bar" orientation="horizontal">
376                         <field name="categ_id"/>
377                         <field name="planned_revenue" operator="+"/>
378                         <field name="state" group="True"/>
379                     </graph>
380                 </field>
381             </record>
382
383 </data>
384 </openerp>