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" groups="base.group_extended"/>
36 <field name="date_action"/>
37 <field name="title_action"/>
38 <field name="priority" string="Priority"/>
40 <field name="type" invisible="1"/>
42 <notebook colspan="4">
43 <page string="Opportunity">
44 <group col="4" colspan="2">
45 <separator colspan="4" string="Contacts"/>
47 <field name="partner_id" select="1"
48 on_change="onchange_partner_id(partner_id, email_from)"
50 <button name="%(action_crm_lead2partner)d"
51 icon="gtk-index" type="action"
53 attrs="{'invisible':[('partner_id','!=',False)]}"/>
55 <field name="partner_address_id"
57 on_change="onchange_partner_address_id(partner_address_id, email_from)"
59 <field name="email_from" string="Email" />
62 <group col="2" colspan="2">
63 <separator colspan="2" string="Categorization"/>
64 <field name="section_id" colspan="1" widget="selection"/>
65 <field name="categ_id" select="1" groups="base.group_extended"
66 string="Category" widget="selection"
67 domain="[('object_id.model', '=', 'crm.lead')]" />
70 <separator colspan="4" string="Details"/>
71 <field name="description" nolabel="1" colspan="4"/>
73 <separator colspan="4"/>
74 <group col="10" colspan="4">
76 <button name="case_reset" string="Reset to Draft"
77 states="done,cancel" type="object"
79 <button name="case_open" string="Open"
80 states="draft,pending" type="object"
81 icon="gtk-go-forward" />
82 <button name="case_pending" string="Pending"
83 states="draft,open" type="object"
84 icon="gtk-media-pause" />
85 <button name="case_escalate" string="Escalate"
86 states="open,pending" type="object"
87 groups="base.group_extended"
89 <button name="case_cancel" string="Cancel"
90 states="draft,open,pending" type="object"
92 <button name="case_mark_lost" string="Mark Lost"
93 states="open,pending" type="object"
95 <button name="case_close" string="Mark Won"
96 states="open,pending" type="object"
101 <group colspan="2" col="4">
102 <separator string="Contact" colspan="4" col="4"/>
103 <field name="partner_name" string="Partner Name" colspan="4"/>
105 <field domain="[('domain', '=', 'contact')]" name="title"/>
106 <field name="function" />
107 <field name="street" colspan="4"/>
108 <field name="street2" colspan="4"/>
111 <field name="country_id"/>
112 <field name="state_id"/>
114 <group colspan="2" col="2">
115 <separator string="Communication" colspan="2"/>
117 <field name="mobile"/>
119 <group colspan="2" col="2">
120 <separator string="Mailings" colspan="2"/>
121 <field name="optin"/>
122 <field name="optout"/>
126 <page string="History" groups="base.group_extended">
128 <field colspan="4" name="email_cc" string="Global CC" widget="char" size="512"/>
130 <field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
131 <tree string="History">
132 <field name="display_text" string="History Information"/>
133 <field name="history" invisible="1"/>
135 string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
136 name="%(crm.action_crm_send_mail)d"
137 context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
138 icon="terp-mail-replied" type="action" />
140 <form string="History">
141 <group col="4" colspan="4">
142 <field name="email_from"/>
144 <field name="email_to" size="512"/>
145 <field name="email_cc" size="512"/>
146 <field name="name" colspan="4"/>
147 <field name="history" invisible="1"/>
149 <notebook colspan="4">
150 <page string="Details">
151 <group attrs="{'invisible': [('history', '!=', True)]}">
152 <field name="description" colspan="4" nolabel="1" height="250"/>
155 name="%(crm.action_crm_send_mail)d"
156 context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
157 icon="terp-mail-replied" type="action" />
159 <group attrs="{'invisible': [('history', '=', True)]}">
160 <field name="display_text" colspan="4" nolabel="1" height="250"/>
163 <page string="Attachments">
164 <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
169 <button string="Add Internal Note"
170 name="%(crm.action_crm_add_note)d"
171 context="{'model': 'crm.lead' }"
172 icon="terp-document-new" type="action" />
173 <button string="Send New Email"
174 name="%(crm.action_crm_send_mail)d"
175 context="{'mail':'new', 'model': 'crm.lead'}"
176 icon="terp-mail-message-new" type="action" />
178 <page string="Extra Info" groups="base.group_extended">
179 <group col="2" colspan="2">
180 <separator string="Dates" colspan="2"/>
181 <field name="create_date"/>
182 <field name="write_date"/>
183 <field name="date_closed"/>
184 <field name="date_open"/>
186 <group col="2" colspan="2">
187 <separator string="Misc" colspan="2"/>
188 <field name="active"/>
189 <field name="day_open"/>
190 <field name="day_close"/>
191 <field name="referred"/>
193 <separator colspan="4" string="References"/>
202 <!-- Opportunities Tree View -->
204 <record model="ir.ui.view" id="crm_case_tree_view_oppor">
205 <field name="name">Opportunities Tree</field>
206 <field name="model">crm.lead</field>
207 <field name="type">tree</field>
208 <field name="arch" type="xml">
209 <tree string="Opportunities" colors="blue:state=='pending';grey:state in ('cancel', 'done');red:date_deadline and (date_deadline < current_date)">
210 <field name="date_deadline" invisible="1"/>
211 <field name="create_date"/>
212 <field name="name" string="Opportunity"/>
213 <field name="partner_id"/>
214 <field name="country_id" invisible="context.get('invisible_country', True)" />
215 <field name="date_action"/>
216 <field name="title_action" />
217 <field name="stage_id"/>
218 <field name="partner_assigned_id" invisible="1"/>
219 <button name="stage_previous" string="Previous Stage"
220 states="open,pending" type="object" icon="gtk-go-back" />
221 <button name="stage_next" string="Next Stage"
222 states="open,pending" type="object"
223 icon="gtk-go-forward" />
224 <field name="planned_revenue" sum="Expected Revenues"/>
225 <field name="probability" widget="progressbar" avg="Avg. of Probability"/>
226 <field name="section_id"
227 invisible="context.get('invisible_section', True)" />
228 <field name="user_id"/>
229 <field name="priority" invisible="1"/>
230 <field name="categ_id" invisible="1"/>
231 <field name="state"/>
232 <button name="case_open" string="Open"
233 states="draft,pending" type="object"
234 icon="gtk-go-forward" />
235 <button name="case_pending" string="Pending"
236 states="open,draft" type="object"
237 icon="gtk-media-pause" />
238 <button name="case_close" string="Won"
239 states="open,draft,pending" type="object"
245 <!-- Opportunities Graph View -->
247 <record model="ir.ui.view" id="crm_case_graph_view_opportunity">
248 <field name="name">CRM - Opportunity Graph</field>
249 <field name="model">crm.lead</field>
250 <field name="type">graph</field>
251 <field name="arch" type="xml">
252 <graph string="Opportunity by Categories" type="bar" orientation="horizontal">
253 <field name="categ_id"/>
254 <field name="planned_revenue" operator="+"/>
255 <field name="state" group="True"/>
260 <!-- Opportunities Search View -->
262 <record id="view_crm_case_opportunities_filter" model="ir.ui.view">
263 <field name="name">CRM - Opportunities Search</field>
264 <field name="model">crm.lead</field>
265 <field name="type">search</field>
266 <field name="arch" type="xml">
267 <search string="Search Opportunities">
268 <filter icon="terp-check"
269 string="Current" help="Draft and Open Opportunities"
271 domain="[('state','in',('draft','open'))]"/>
272 <filter icon="terp-camera_test"
273 string="Open" help="Open Opportunities"
274 domain="[('state','=','open')]"/>
275 <filter icon="terp-gtk-media-pause"
276 string="Pending" help="Pending Opportunities"
277 domain="[('state','=','pending')]"/>
278 <separator orientation="vertical"/>
279 <filter icon="terp-go-today" string="Today"
280 domain="[('create_date','<', time.strftime('%%Y-%%m-%%d 23:59:59')), ('create_date','>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]"
281 help="Todays' Opportunities" />
282 <filter icon="terp-go-week" string="7 Days"
283 help="Opportunities created during last 7 days"
284 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'))]"
286 <separator orientation="vertical"/>
287 <field name="name" string="Opportunity"/>
288 <field name="partner_id"/>
289 <field name="user_id">
290 <filter icon="terp-personal-"
291 domain="[('user_id','=', False)]"
292 help="Unassigned Opportunities" />
294 <field name="section_id"
295 default="context.get('section_id', False)"
296 context="{'invisible_section': False}"
298 <filter icon="terp-personal+"
299 domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
300 context="{'invisible_section': False}"
301 help="My Sales Team(s)" />
302 <filter icon="terp-personal+"
303 context="{'invisible_section': False}"
305 help="Show Sales Team"/>
308 <group expand="0" string="Extended Filters..." groups="base.group_extended">
309 <field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
310 <field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
311 <separator orientation="vertical"/>
312 <field name="country_id" context="{'invisible_country': False}">
313 <filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
315 <separator orientation="vertical"/>
316 <field name="company_id" widget="selection" groups="base.group_multi_company"/>
318 <field name="create_date" string="Creation Date"/>
319 <field name="date_closed"/>
322 <group expand="0" string="Group By..." colspan="16">
323 <filter string="Salesman" icon="terp-personal"
324 domain="[]" context="{'group_by':'user_id'}" />
325 <filter string="Team" help="Sales Team" icon="terp-personal+" domain="[]" context="{'group_by':'section_id'}"/>
326 <filter string="Assigned Partner" icon="terp-partner"
327 domain="[]" context="{'group_by':'partner_assigned_id'}" />
328 <separator orientation="vertical" />
329 <filter string="Stage" icon="terp-stage" domain="[]"
330 context="{'group_by':'stage_id'}" />
331 <filter string="Priority" icon="terp-rating-rated" domain="[]"
332 context="{'group_by':'priority'}" />
333 <filter string="Category" icon="terp-stock_symbol-selection"
334 domain="[]" context="{'group_by':'categ_id'}" />
335 <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
336 <separator orientation="vertical" />
337 <filter string="Creation" icon="terp-go-month"
338 domain="[]" context="{'group_by':'create_date'}" />
339 <filter string="Exp.Closing"
341 help="Expected Closing" domain="[]"
342 context="{'group_by':'date_deadline'}" />
349 <!-- Opportunities Graph View -->
351 <record model="ir.ui.view" id="crm_case_graph_view_opportunity">
352 <field name="name">CRM - Opportunity Graph</field>
353 <field name="model">crm.lead</field>
354 <field name="type">graph</field>
355 <field name="arch" type="xml">
356 <graph string="Opportunity by Categories" type="bar" orientation="horizontal">
357 <field name="categ_id"/>
358 <field name="planned_revenue" operator="+"/>
359 <field name="state" group="True"/>