4 <!-- Opportunities Form View -->
5 <record model="ir.ui.view" id="crm_case_form_view_oppor">
6 <field name="name">Opportunities</field>
7 <field name="model">crm.lead</field>
8 <field name="type">form</field>
9 <field name="priority">10</field>
10 <field name="arch" type="xml">
11 <form string="Opportunities">
12 <group colspan="4" col="7">
13 <field name="name" required="1" string="Opportunity"/>
14 <label string="Stage:" align="1.0"/>
15 <group colspan="1" col="4">
16 <field name="stage_id" nolabel="1"
17 on_change="onchange_stage_id(stage_id)"
18 domain="[('section_id','=',section_id), ('object_id.model', '=', 'crm.lead')]" />
19 <button name="stage_previous"
20 states="open,pending" type="object"
21 icon="gtk-go-back" string="" />
22 <button name="stage_next" states="open,pending"
23 type="object" icon="gtk-go-forward" string="" />
25 <field name="user_id"/>
27 <button name="action_makeMeeting" type="object"
28 string="Schedule Meeting" icon="gtk-redo" />
30 <field name="planned_revenue"/>
31 <field name="probability"/>
32 <field name="date_deadline" string="Expected Closing"/>
33 <button string="Schedule/Log Call"
34 name="%(opportunity2phonecall_act)d" icon="terp-call-start" type="action" />
36 <field name="date_action"/>
37 <field name="title_action"/>
38 <field name="priority" string="Priority"/>
39 <button string="Merge with other Opportunity"
40 name="%(merge_opportunity_act)d" icon="gtk-add" type="action" />
42 <field name="type" invisible="1"/>
44 <notebook colspan="4">
45 <page string="Opportunity">
46 <group col="4" colspan="2">
47 <separator colspan="4" string="Contacts"/>
49 <field name="partner_id" select="1"
50 on_change="onchange_partner_id(partner_id, email_from)"
52 <button name="%(action_crm_lead2partner)d"
53 icon="gtk-index" type="action"
55 attrs="{'invisible':[('partner_id','!=',False)]}"/>
57 <field name="partner_address_id"
59 on_change="onchange_partner_address_id(partner_address_id, email_from)"
61 <field name="email_from" string="Email" />
64 <group col="2" colspan="2">
65 <separator colspan="2" string="Categorization"/>
66 <field name="section_id" colspan="1" widget="selection"/>
67 <field name="categ_id" select="1" groups="base.group_extended"
68 string="Category" widget="selection"
69 domain="[('object_id.model', '=', 'crm.lead')]" />
72 <separator colspan="4" string="Details"/>
73 <field name="description" nolabel="1" colspan="4"/>
75 <separator colspan="4"/>
76 <group col="10" colspan="4">
78 <button name="case_reset" string="Reset to Draft"
79 states="done,cancel" type="object"
81 <button name="case_open" string="Open"
82 states="draft,pending" type="object"
83 icon="gtk-go-forward" />
84 <button name="case_pending" string="Pending"
85 states="draft,open" type="object"
86 icon="gtk-media-pause" />
87 <button name="case_escalate" string="Escalate"
88 states="open,pending" type="object"
89 groups="base.group_extended"
91 <button name="case_cancel" string="Cancel"
92 states="draft,open,pending" type="object"
94 <button name="case_mark_lost" string="Mark Lost"
95 states="open,pending" type="object"
97 <button name="case_close" string="Mark Won"
98 states="open,pending" type="object"
103 <group colspan="2" col="4">
104 <separator string="Contact" colspan="4" col="4"/>
105 <field name="partner_name" string="Partner Name" colspan="4"/>
107 <field domain="[('domain', '=', 'contact')]" name="title"/>
108 <field name="function" />
109 <field name="street" colspan="4"/>
110 <field name="street2" colspan="4"/>
113 <field name="country_id"/>
114 <field name="state_id"/>
116 <group colspan="2" col="2">
117 <separator string="Communication" colspan="2"/>
119 <field name="mobile"/>
121 <group colspan="2" col="2">
122 <separator string="Mailings" colspan="2"/>
123 <field name="optin"/>
124 <field name="optout"/>
128 <page string="History" groups="base.group_extended">
130 <field colspan="4" name="email_cc" string="Global CC" widget="char" size="512"/>
132 <field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
133 <tree string="Communication history">
134 <field name="display_text" string="History Information"/>
136 string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
137 name="%(crm.action_crm_send_mail)d"
138 context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
139 icon="terp-mail-replied" type="action" />
141 <form string="Communication history">
142 <group col="4" colspan="4">
143 <field name="email_from"/>
145 <field name="email_to" widget="char" size="512"/>
146 <field name="email_cc" widget="char" size="512"/>
147 <field name="name" colspan="4" widget="char" size="512"/>
148 <field name="history" invisible="1"/>
150 <notebook colspan="4">
151 <page string="Details">
152 <group attrs="{'invisible': [('history', '!=', True)]}">
153 <field name="description" colspan="4" nolabel="1" height="250"/>
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 <group attrs="{'invisible': [('history', '=', True)]}">
161 <field name="display_text" colspan="4" nolabel="1" height="250"/>
164 <page string="Attachments">
165 <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
170 <button string="Send New Email"
171 name="%(crm.action_crm_send_mail)d"
172 context="{'mail':'new', 'model': 'crm.lead'}"
173 icon="terp-mail-message-new" type="action" />
174 <button string="Add New Note"
175 name="%(crm.action_crm_add_note)d"
176 context="{'model': 'crm.lead' }"
177 icon="terp-mail-message-new" type="action" />
178 <button string="Forward"
179 name="%(crm_lead_forward_to_partner_act)d"
180 icon="terp-mail-forward" type="action" />
182 <page string="Extra Info" groups="base.group_extended">
183 <group col="2" colspan="2">
184 <separator string="Dates" colspan="2"/>
185 <field name="create_date"/>
186 <field name="write_date"/>
187 <field name="date_closed"/>
188 <field name="date_open"/>
190 <group col="2" colspan="2">
191 <separator string="Misc" colspan="2"/>
192 <field name="active"/>
193 <field name="day_open"/>
194 <field name="day_close"/>
195 <field name="referred"/>
197 <separator colspan="4" string="References"/>
201 <page string="Assignation" groups="base.group_extended">
202 <group name="partner_assign_group" col="5" colspan="4">
203 <separator string="Partner Assignation" colspan="5"/>
204 <field name="partner_assigned_id" on_change="onchange_assign_id(partner_assigned_id)"/>
205 <field name="date_assign"/>
206 <group colspan="1" col="1">
207 <button string="Forward"
208 attrs="{'invisible':[('partner_assigned_id','=',False)]}"
209 name="%(crm_lead_forward_to_partner_act)d"
210 icon="terp-mail-forward" type="action"
211 context="{'default_name': 'partner', 'default_partner_id': partner_assigned_id}"
221 <!-- Opportunities Tree View -->
223 <record model="ir.ui.view" id="crm_case_tree_view_oppor">
224 <field name="name">Opportunities Tree</field>
225 <field name="model">crm.lead</field>
226 <field name="type">tree</field>
227 <field name="arch" type="xml">
228 <tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:date_deadline and (date_deadline < current_date)">
229 <field name="date_deadline" invisible="1"/>
230 <field name="create_date"/>
231 <field name="name" string="Opportunity"/>
232 <field name="partner_id"/>
233 <field name="country_id" invisible="context.get('invisible_country', True)" />
234 <field name="date_action"/>
235 <field name="stage_id"/>
236 <field name="partner_assigned_id" invisible="1"/>
237 <button name="stage_previous" string="Previous Stage"
238 states="open,pending" type="object" icon="gtk-go-back" />
239 <button name="stage_next" string="Next Stage"
240 states="open,pending" type="object"
241 icon="gtk-go-forward" />
242 <field name="planned_revenue" sum="Total of Planned Revenue"/>
243 <field name="probability" widget="progressbar" avg="Avg. of Probability"/>
244 <field name="section_id"
245 invisible="context.get('invisible_section', True)" />
246 <field name="user_id"/>
247 <field name="priority" invisible="1"/>
248 <field name="categ_id" invisible="1"/>
249 <field name="state"/>
250 <button name="case_open" string="Open"
251 states="draft,pending" type="object"
252 icon="gtk-go-forward" />
253 <button name="case_pending" string="Pending"
254 states="open,draft" type="object"
255 icon="gtk-media-pause" />
256 <button name="case_mark_lost" string="Lost"
257 states="open,pending" type="object"
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="Current 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 <filter icon="terp-go-today" string="Today"
301 domain="[('create_date','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]"
302 help="Todays' Opportunities" />
303 <filter icon="terp-go-week" string="7 Days"
304 help="Opportunities created during last 7 days"
305 domain="[('create_date','<', time.strftime('%%Y-%%m-%%d 23:59:59')),('create_date','>=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d 00:00:00'))]"
307 <separator orientation="vertical"/>
308 <field name="name" string="Opportunity"/>
309 <field name="user_id">
310 <filter icon="terp-personal-"
311 domain="[('user_id','=', False)]"
312 help="Unassigned Opportunities" />
314 <field name="email_from"/>
315 <field name="section_id"
316 default="context.get('section_id', False)"
317 context="{'invisible_section': False}"
319 <filter icon="terp-personal+"
320 domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
321 context="{'invisible_section': False}"
322 help="My Sales Team(s)" />
323 <filter icon="terp-personal+"
324 context="{'invisible_section': False}"
326 help="Show Sales Team"/>
329 <group expand="0" string="Group By..." colspan="16">
330 <filter string="Stage" icon="terp-stage" domain="[]"
331 context="{'group_by':'stage_id'}" />
332 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
333 <filter string="Priority" icon="terp-rating-rated" domain="[]"
334 context="{'group_by':'priority'}" />
335 <filter string="Category" icon="terp-stock_symbol-selection"
336 domain="[]" context="{'group_by':'categ_id'}" />
337 <separator orientation="vertical" />
338 <filter string="Salesman" icon="terp-personal"
339 domain="[]" context="{'group_by':'user_id'}" />
340 <filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
341 <filter string="Assigned Partner" icon="terp-personal"
342 domain="[]" context="{'group_by':'partner_assigned_id'}" />
343 <separator orientation="vertical" />
344 <filter string="Creation" icon="terp-go-month"
345 domain="[]" context="{'group_by':'create_date'}" />
346 <filter string="Exp.Closing"
348 help="Expected Closing" domain="[]"
349 context="{'group_by':'date_deadline'}" />
352 <group expand="0" string="Extended Filters..." groups="base.group_extended">
353 <field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
354 <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
355 <separator orientation="vertical"/>
356 <field name="country_id" context="{'invisible_country': False}">
357 <filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
359 <separator orientation="vertical"/>
360 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
362 <field name="create_date" string="Creation Date"/>
363 <field name="date_closed"/>
370 <!-- Opportunities Graph View -->
372 <record model="ir.ui.view" id="crm_case_graph_view_opportunity">
373 <field name="name">CRM - Opportunity Graph</field>
374 <field name="model">crm.lead</field>
375 <field name="type">graph</field>
376 <field name="arch" type="xml">
377 <graph string="Opportunity by Categories" type="bar" orientation="horizontal">
378 <field name="categ_id"/>
379 <field name="planned_revenue" operator="+"/>
380 <field name="state" group="True"/>