[MERGE] merge with team1 branch
[odoo/odoo.git] / addons / crm / crm_phonecall_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5 <!--  Phonecall Categories Form View  -->
6
7     <record id="crm_phonecall_categ_action" model="ir.actions.act_window">
8         <field name="name">Phonecall Categories</field>
9         <field name="res_model">crm.case.categ</field>
10         <field name="view_type">form</field>
11         <field name="view_id" ref="crm.crm_case_categ_tree-view"/>
12         <field name="domain">[('object_id.model', '=', 'crm.phonecall')]</field>
13         <field name="context">{'object_id':'crm.phonecall'}</field>
14         <field name="help">Create specific phone call categories to better define the type of calls tracked in the system.</field>
15     </record>
16
17     <menuitem action="crm_phonecall_categ_action" name="Categories"
18         id="menu_crm_case_phonecall-act" parent="menu_crm_config_phonecall" />
19
20 <!--  PhoneCalls Tree View -->
21
22     <record model="ir.ui.view" id="crm_case_phone_tree_view">
23         <field name="name">CRM - Phone Calls Tree</field>
24         <field name="model">crm.phonecall</field>
25         <field name="type">tree</field>
26         <field name="arch" type="xml">
27             <tree colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
28                 <field name="date"/>
29                 <field name="name"/>
30                 <field name="partner_id"/>
31                 <field name="partner_contact"/>
32                 <field name="partner_phone"/>
33                 <field name="user_id"/>
34                 <field name="categ_id" string="Type"/>
35                 <field name="create_date" invisible="1"/>
36                 <button string="Convert to Opportunity"
37                     name="%(phonecall2opportunity_act)d"
38                     states="draft,open,pending"
39                     icon="gtk-index"
40                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
41                 <button string="Meeting"
42                     states="draft,open,pending" icon="gtk-redo"
43                      name="action_make_meeting" type="object" />
44                 <field name="state"/>
45                 <button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
46                 <button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
47                 <button name="case_close" string="Held" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
48                 <button name="case_pending" string="Not Held" states="open" type="object" icon="gtk-media-pause"/>
49             </tree>
50         </field>
51     </record>
52
53 <!-- Phonecalls Form View -->
54
55     <record model="ir.ui.view" id="crm_case_phone_form_view">
56         <field name="name">CRM - Phone Call Form</field>
57         <field name="model">crm.phonecall</field>
58         <field name="type">form</field>
59         <field name="arch" type="xml">
60             <form string="Phone Call">
61                  <group colspan="6" col="7">
62                     <field name="name" required="1"/>
63                     <field name="partner_phone" required="1"/>
64                     <field name="duration" widget="float_time" required="1"/>
65                     <button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
66
67                     <field name="date" required="1"/>
68                     <field name="user_id"/>
69                     <field name="section_id" colspan="1" widget="selection" />
70                     <button string="Convert to Opportunity"
71                         name="%(phonecall2opportunity_act)d"
72                         icon="gtk-index" type="action"
73                         attrs="{'invisible':[('opportunity_id','!=',False)]}" />
74                     <label colspan="6"  string=""/>
75                     <button string="Schedule Other Call"
76                      icon="terp-call-start"
77                     name="%(phonecall_to_phonecall_act)d"
78                     type="action"  />
79
80                 </group>
81
82                 <group col="3" colspan="2">
83                     <separator colspan="3" string="Contacts" />
84                     <field name="partner_id"
85                         on_change="onchange_partner_id(partner_id, email_from)" />
86                     <button string="Create a Partner"
87                         icon="terp-partner"
88                         name="%(action_crm_phonecall2partner)d"
89                         type="action"
90                         attrs="{'invisible':[('partner_id','!=',False)]}" />
91                     <newline/>
92                     <field name="partner_address_id"
93                         on_change="onchange_partner_address_id(partner_address_id, email_from)" />
94                     <newline/>
95                     <field name="partner_mobile" />
96                 </group>
97                 <group col="2" colspan="2">
98                     <separator colspan="2" string="Categorization" />
99                     <field name="categ_id" widget="selection"
100                         domain="[('object_id.model', '=', 'crm.phonecall')]"
101                         string="Type" />
102                     <field name="priority"/>
103                     <field name="opportunity_id"/>
104                 </group>
105                 <separator string="Description" colspan="4" />
106                 <field name="description" nolabel="1" colspan="4" />
107                 <separator colspan="4" />
108                 <group col="8" colspan="4">
109                     <field name="state" select="1" />
110                     <button name="case_cancel" string="Cancel"
111                         states="draft,open,pending" type="object"
112                         icon="gtk-cancel" />
113                     <button name="case_open" string="Open"
114                         states="draft,pending" type="object"
115                         icon="gtk-go-forward" />
116                     <button name="case_pending" string="Not Held"
117                         states="open" type="object" icon="gtk-media-pause" />
118                     <button name="case_close" string="Held"
119                         states="open,draft,pending" type="object"
120                         icon="gtk-jump-to" />
121                     <button name="case_reset" string="Reset to Draft"
122                         states="done,cancel" type="object"
123                         icon="gtk-convert" />
124                 </group>
125             </form>
126         </field>
127     </record>
128
129         <!--Inbound Phonecalls Form View -->
130
131         <record model="ir.ui.view" id="crm_case_inbound_phone_form_view">
132         <field name="name">CRM - Inbound Phone Call Form</field>
133         <field name="model">crm.phonecall</field>
134         <field name="type">form</field>
135         <field name="arch" type="xml">
136             <form string="Phone Call">
137                 <group colspan="4" col="7">
138                     <field name="name" required="1"/>
139                     <field name="partner_phone"/>
140                     <field name="duration" widget="float_time"/>
141                     <button string="Schedule a Meeting"
142                         name="action_make_meeting"
143                         icon="gtk-redo"
144                         type="object" />
145
146                     <field name="date" required="1"/>
147                     <field name="user_id"/>
148                     <field name="section_id" colspan="1" widget="selection" />
149                     <button string="Convert to Opportunity"
150                         name="%(phonecall2opportunity_act)d"
151                         icon="gtk-index" type="action"
152                         attrs="{'invisible':[('opportunity_id','!=',False)]}" />
153                     <label colspan="6"  string=""/>
154                     <button string="Schedule Other Call"
155                      icon="terp-call-start"
156                     name="%(phonecall_to_phonecall_act)d"
157                     type="action"  />
158
159                 </group>
160                 <group col="3" colspan="2">
161                     <separator colspan="3" string="Contacts" />
162                     <field name="partner_id"
163                         on_change="onchange_partner_id(partner_id, email_from)" />
164                     <button string="Create a Partner"
165                         icon="terp-partner"
166                         name="%(action_crm_phonecall2partner)d"
167                         type="action"
168                         attrs="{'invisible':[('partner_id','!=',False)]}" />
169                     <newline/>
170                     <field name="partner_address_id"
171                         on_change="onchange_partner_address_id(partner_address_id, email_from)" />
172                     <newline/>
173                     <field name="partner_mobile" />
174                 </group>
175                 <group col="2" colspan="2">
176                     <separator colspan="2" string="Categorization" />
177                     <field name="categ_id" widget="selection"
178                         domain="[('object_id.model', '=', 'crm.phonecall')]"
179                         string="Type" />
180                     <field name="priority"/>
181                     <field name="opportunity_id"/>
182                 </group>
183                 <separator string="Description" colspan="4" />
184                 <field name="description" nolabel="1" colspan="4" />
185                 <separator colspan="4" />
186             </form>
187         </field>
188     </record>
189
190     <!--Inbound Phonecalls Tree View -->
191
192     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
193         <field name="name">CRM - Inbound Phone Calls Tree</field>
194         <field name="model">crm.phonecall</field>
195         <field name="type">tree</field>
196         <field name="arch" type="xml">
197             <tree string="Phone Calls" colors="grey:state in ('cancel','done');blue:state in ('pending',)">
198                 <field name="date"/>
199                 <field name="name"/>
200                 <field name="partner_id"
201                         on_change="onchange_partner_id(partner_id, email_from)"
202                         string="Partner" />
203                 <field name="partner_address_id"
204                         on_change="onchange_partner_address_id(partner_address_id, email_from)" />
205                 <field name="partner_phone"/>
206                 <field name="user_id"/>
207                 <field name="categ_id" widget="selection"
208                         domain="[('object_id.model', '=', 'crm.phonecall')]"
209                         string="Type" />
210                 <field name="state" invisible="1"/>
211                 <field name="create_date" invisible="1"/>
212                 <button string="Schedule Other Call"
213                     icon="terp-call-start"
214                     name="%(phonecall_to_phonecall_act)d"
215                     type="action"  />
216                 <button string="Convert to Opportunity"
217                     name="%(phonecall2opportunity_act)d"
218                     states="draft,open,pending"
219                     icon="gtk-index"
220                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
221                 <button string="Meeting"
222                     states="draft,open,pending" icon="gtk-redo"
223                      name="action_make_meeting" type="object" />
224             </tree>
225         </field>
226     </record>
227
228 <!-- Phonecalls Calendar View -->
229
230     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
231         <field name="name">CRM - Phone Calls Calendar</field>
232         <field name="model">crm.phonecall</field>
233         <field name="type">calendar</field>
234         <field name="priority" eval="2"/>
235         <field name="arch" type="xml">
236             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
237                 <field name="name"/>
238                 <field name="partner_id"/>
239             </calendar>
240         </field>
241     </record>
242
243 <!-- Phonecalls Search View  -->
244
245     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
246         <field name="name">CRM - Phone Calls Search</field>
247         <field name="model">crm.phonecall</field>
248         <field name="type">search</field>
249         <field name="arch" type="xml">
250             <search string="Search Phonecalls">
251                <filter icon="terp-check" string="Current"
252                    name="current"
253                    domain="[('state','in', ('draft','open','pending'))]"/>
254                <filter icon="terp-go-today" string="Today"
255                    domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),
256                     ('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]"
257                    name="today"
258                    help="Todays's Phonecalls"
259                />
260                <filter icon="terp-go-week"
261                    string="7 Days"
262                    help="Phonecalls during last 7 days"
263                    domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
264                />
265
266                <separator orientation="vertical"/>
267                <field name="name"/>
268                <field name="partner_id"/>
269                <field name="user_id">
270                    <filter icon="terp-personal-"
271                        domain="[('user_id','=',False)]"
272                        help="Unassigned Phonecalls" />
273                </field>
274                <field name="section_id"
275                    select="1" widget="selection" string="Sales Team">
276                    <filter icon="terp-personal+" groups="base.group_extended"
277                        domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
278                        help="My Sales Team(s)" />
279                </field>
280                <newline/>
281                <group expand="0" string="Group By..." colspan="4">
282                    <filter string="Partner" icon="terp-partner" domain="[]"
283                        context="{'group_by':'partner_id'}" />
284                    <filter string="Responsible" icon="terp-personal"
285                        domain="[]" context="{'group_by':'user_id'}" />
286                    <separator orientation="vertical" />
287                    <filter string="Creation" icon="terp-go-month" help="Creation Date"
288                        domain="[]" context="{'group_by':'create_date'}" />
289                    <filter string="Date" icon="terp-go-month" domain="[]"
290                        context="{'group_by':'date'}" help="Date of Call" />
291                </group>
292            </search>
293         </field>
294     </record>
295
296     </data>
297 </openerp>