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>
15 <menuitem action="crm_opportunity_stage_act" id="menu_crm_opportunity_stage_act" name="Stages"
16 groups="base.group_extended" sequence="0"
17 parent="base.menu_crm_config_opportunity" />
19 <!-- Opportunities Form View -->
20 <record model="ir.ui.view" id="crm_case_form_view_oppor">
21 <field name="name">Opportunities</field>
22 <field name="model">crm.lead</field>
23 <field name="type">form</field>
24 <field name="priority">10</field>
25 <field name="arch" type="xml">
26 <form string="Opportunities">
27 <group colspan="4" col="7">
28 <field name="name" required="1" string="Opportunity"/>
29 <label string="Stage:" align="1.0"/>
30 <group colspan="1" col="4">
31 <field name="stage_id" nolabel="1"
32 on_change="onchange_stage_id(stage_id)"
33 domain="[('type','=','opportunity'),('section_ids', '=', section_id)]"/>
34 <button name="stage_previous"
35 states="draft,open,pending" type="object"
36 icon="gtk-go-back" string="" />
37 <button name="stage_next" states="draft,open,pending"
38 type="object" icon="gtk-go-forward" string="" context="{'stage_type': 'opportunity'}"/>
40 <field name="user_id"/>
42 <button name="action_makeMeeting" type="object"
43 string="Schedule Meeting" icon="gtk-redo" />
45 <field name="planned_revenue"/>
46 <field name="probability"/>
47 <field name="date_deadline"/>
48 <button string="Schedule/Log Call"
49 name="%(opportunity2phonecall_act)d" icon="terp-call-start" type="action" groups="base.group_extended"/>
51 <field name="date_action"/>
52 <field name="title_action"/>
53 <field name="priority" string="Priority"/>
55 <field name="type" invisible="1"/>
57 <notebook colspan="4">
58 <page string="Opportunity">
59 <group col="4" colspan="2">
60 <separator colspan="4" string="Contacts"/>
62 <field name="partner_id" select="1"
63 on_change="onchange_partner_id(partner_id, email_from)" string="Customer"
65 <button name="%(action_crm_lead2partner)d"
66 icon="terp-partner" type="action"
68 attrs="{'invisible':[('partner_id','!=',False)]}"/>
70 <field name="partner_address_id"
72 on_change="onchange_partner_address_id(partner_address_id, email_from)"
74 <field name="email_from" string="Email" />
77 <group col="2" colspan="2">
78 <separator colspan="2" string="Categorization"/>
79 <field name="section_id" colspan="1" widget="selection"/>
80 <field name="categ_id" select="1"
81 string="Category" widget="selection"
82 domain="[('object_id.model', '=', 'crm.lead')]" />
85 <separator colspan="4" string="Details"/>
86 <field name="description" nolabel="1" colspan="4"/>
88 <separator colspan="4"/>
89 <group col="10" colspan="4">
91 <button name="case_cancel" string="Cancel"
92 states="draft" type="object"
94 <button name="case_mark_lost" string="Mark Lost"
95 states="open,pending" type="object"
97 <button name="case_reset" string="Reset to Draft"
98 states="done,cancel" type="object"
100 <button name="case_open" string="Open"
101 states="draft,pending" type="object"
102 icon="gtk-go-forward" />
103 <button name="case_pending" string="Pending"
104 states="draft,open" type="object"
105 icon="gtk-media-pause" />
106 <button name="case_escalate" string="Escalate"
107 states="open,pending" type="object"
108 groups="base.group_extended"
110 <button name="case_close" string="Mark Won"
111 states="open,pending" type="object"
116 <group colspan="2" col="4">
117 <separator string="Contact" colspan="4" col="4"/>
118 <field name="partner_name" string="Customer Name" colspan="4"/>
120 <field domain="[('domain', '=', 'contact')]" name="title" widget="selection"/>
121 <field name="function" />
122 <field name="street" colspan="4"/>
123 <field name="street2" colspan="4"/>
126 <field name="country_id"/>
127 <field name="state_id"/>
129 <group colspan="2" col="2">
130 <separator string="Communication" colspan="2"/>
132 <field name="mobile"/>
134 <group colspan="2" col="2">
135 <separator string="Categorization" colspan="2"/>
136 <field name="type_id" widget="selection" groups="base.group_extended"/>
137 <field name="channel_id" widget="selection"/>
139 <group colspan="2" col="2">
140 <separator string="Mailings" colspan="2"/>
141 <field name="optin"/>
142 <field name="optout"/>
146 <page string="History" groups="base.group_extended">
148 <field colspan="4" name="email_cc" string="Global CC" widget="char" size="512"/>
150 <field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
151 <tree string="History">
152 <field name="display_text" string="History Information"/>
153 <field name="history" invisible="1"/>
155 string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
156 name="%(crm.action_crm_send_mail)d"
157 context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
158 icon="terp-mail-replied" type="action" />
160 <form string="History">
161 <group col="4" colspan="4">
162 <field name="email_from"/>
164 <field name="email_to" size="512"/>
165 <field name="email_cc" size="512"/>
166 <field name="name" colspan="4"/>
167 <field name="history" invisible="1"/>
169 <notebook colspan="4">
170 <page string="Details">
171 <group attrs="{'invisible': [('history', '!=', True)]}">
172 <field name="description" colspan="4" nolabel="1" height="250"/>
175 name="%(crm.action_crm_send_mail)d"
176 context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
177 icon="terp-mail-replied" type="action" />
179 <group attrs="{'invisible': [('history', '=', True)]}">
180 <field name="display_text" colspan="4" nolabel="1" height="250"/>
183 <page string="Attachments">
184 <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
189 <button string="Add Internal Note"
190 name="%(crm.action_crm_add_note)d"
191 context="{'model': 'crm.lead' }"
192 icon="terp-document-new" type="action" />
193 <button string="Send New Email"
194 name="%(crm.action_crm_send_mail)d"
195 context="{'mail':'new', 'model': 'crm.lead'}"
196 icon="terp-mail-message-new" type="action" />
198 <page string="Extra Info" groups="base.group_extended">
199 <group col="2" colspan="2">
200 <separator string="Dates" colspan="2"/>
201 <field name="create_date"/>
202 <field name="write_date"/>
203 <field name="date_closed"/>
204 <field name="date_open"/>
206 <group col="2" colspan="2">
207 <separator string="Misc" colspan="2"/>
208 <field name="active"/>
209 <field name="day_open"/>
210 <field name="day_close"/>
211 <field name="referred"/>
213 <separator colspan="4" string="References"/>
222 <!-- Opportunities Tree View -->
224 <record model="ir.ui.view" id="crm_case_tree_view_oppor">
225 <field name="name">Opportunities Tree</field>
226 <field name="model">crm.lead</field>
227 <field name="type">tree</field>
228 <field name="arch" type="xml">
229 <tree string="Opportunities" colors="blue:state=='pending' and not(date_deadline and (date_deadline < current_date));gray:state in ('cancel', 'done');red:date_deadline and (date_deadline < current_date)">
230 <field name="date_deadline" invisible="1"/>
231 <field name="create_date"/>
232 <field name="name" string="Opportunity"/>
233 <field name="partner_id" string="Customer"/>
234 <field name="country_id" invisible="context.get('invisible_country', True)" />
235 <field name="date_action"/>
236 <field name="title_action" />
237 <field name="stage_id"/>
238 <field name="channel_id" invisible="1"/>
239 <field name="type_id" invisible="1"/>
240 <button name="stage_previous" string="Previous Stage"
241 states="open,pending" type="object" icon="gtk-go-back" />
242 <button name="stage_next" string="Next Stage"
243 states="open,pending" type="object"
244 icon="gtk-go-forward" />
245 <field name="planned_revenue" sum="Expected Revenues"/>
246 <field name="probability" widget="progressbar" avg="Avg. of Probability"/>
247 <field name="section_id"
248 invisible="context.get('invisible_section', True)" />
249 <field name="user_id"/>
250 <field name="priority" invisible="1"/>
251 <field name="categ_id" invisible="1"/>
252 <field name="state"/>
253 <button name="case_open" string="Open"
254 states="draft,pending" type="object"
255 icon="gtk-go-forward" />
256 <button name="case_pending" string="Pending"
257 states="open,draft" type="object"
258 icon="gtk-media-pause" />
259 <button name="case_close" string="Won"
260 states="open,draft,pending" type="object"
266 <!-- Opportunities Graph View -->
268 <record model="ir.ui.view" id="crm_case_graph_view_opportunity">
269 <field name="name">CRM - Opportunity Graph</field>
270 <field name="model">crm.lead</field>
271 <field name="type">graph</field>
272 <field name="arch" type="xml">
273 <graph string="Opportunity by Categories" type="bar" orientation="horizontal">
274 <field name="categ_id"/>
275 <field name="planned_revenue" operator="+"/>
276 <field name="state" group="True"/>
281 <!-- Opportunities Search View -->
283 <record id="view_crm_case_opportunities_filter" model="ir.ui.view">
284 <field name="name">CRM - Opportunities Search</field>
285 <field name="model">crm.lead</field>
286 <field name="type">search</field>
287 <field name="arch" type="xml">
288 <search string="Search Opportunities">
289 <filter icon="terp-check"
290 string="Current" help="Draft and Open Opportunities"
292 domain="[('state','in',('draft','open'))]"/>
293 <filter icon="terp-camera_test"
294 string="Open" help="Open Opportunities"
295 domain="[('state','=','open')]"/>
296 <filter icon="terp-gtk-media-pause"
297 string="Pending" help="Pending Opportunities"
298 domain="[('state','=','pending')]"/>
299 <separator orientation="vertical"/>
300 <field name="name" string="Opportunity"/>
301 <field name="partner_id" string="Customer"/>
302 <field name="user_id">
303 <filter icon="terp-personal-"
304 domain="[('user_id','=', False)]"
305 help="Unassigned Opportunities" />
307 <field name="section_id"
308 context="{'invisible_section': False}"
310 <filter icon="terp-personal+" groups="base.group_extended"
311 domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
312 context="{'invisible_section': False}"
313 help="My Sales Team(s)" />
314 <filter icon="terp-personal+" groups="base.group_extended"
315 context="{'invisible_section': False}"
317 help="Show Sales Team"/>
320 <group expand="0" string="Extended Filters..." groups="base.group_extended">
321 <field name="stage_id" widget="selection" domain="[('type', '=', 'opportunity')]"/>
322 <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
323 <separator orientation="vertical"/>
324 <field name="country_id" context="{'invisible_country': False}">
325 <filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
327 <separator orientation="vertical"/>
328 <field name="email_from"/>
329 <separator orientation="vertical"/>
330 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
332 <field name="create_date" string="Creation Date"/>
333 <field name="date_closed"/>
336 <group expand="0" string="Group By..." colspan="16">
337 <filter string="Salesman" icon="terp-personal"
338 domain="[]" context="{'group_by':'user_id'}" />
339 <filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
340 <separator orientation="vertical" />
341 <filter string="Stage" icon="terp-stage" domain="[]"
342 context="{'group_by':'stage_id'}" />
343 <filter string="Priority" icon="terp-rating-rated" domain="[]"
344 context="{'group_by':'priority'}" />
345 <filter string="Category" icon="terp-stock_symbol-selection"
346 domain="[]" context="{'group_by':'categ_id'}" />
347 <filter string="Campaign" icon="terp-gtk-jump-to-rtl"
348 domain="[]" context="{'group_by':'type_id'}" groups="base.group_extended"/>
349 <filter string="Channel" icon="terp-call-start"
350 domain="[]" context="{'group_by':'channel_id'}" />
351 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
352 <separator orientation="vertical" />
353 <filter string="Creation" icon="terp-go-month"
354 domain="[]" context="{'group_by':'create_date'}" />
355 <filter string="Exp.Closing"
357 help="Expected Closing" domain="[]"
358 context="{'group_by':'date_deadline'}" />
365 <!-- Opportunities Graph View -->
367 <record model="ir.ui.view" id="crm_case_graph_view_opportunity">
368 <field name="name">CRM - Opportunity Graph</field>
369 <field name="model">crm.lead</field>
370 <field name="type">graph</field>
371 <field name="arch" type="xml">
372 <graph string="Opportunity by Categories" type="bar" orientation="horizontal">
373 <field name="categ_id"/>
374 <field name="planned_revenue" operator="+"/>
375 <field name="state" group="True"/>