[MERGE] Merged from main 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     </record>
15
16     <menuitem action="crm_phonecall_categ_action"
17         id="menu_crm_case_phonecall-act" parent="crm.menu_crm_case_categ" />
18
19 <!-- ResourceType Form View -->
20
21     <record id="crm_phonecall_resource_act" model="ir.actions.act_window">
22             <field name="name">Phonecall Resource Type</field>
23             <field name="res_model">crm.case.resource.type</field>
24             <field name="view_type">form</field>
25             <field name="view_id" ref="crm.crm_case_resource_type_tree"/>
26             <field name="domain">[('object_id.model', '=', 'crm.phonecall')]</field>
27             <field name="context">{'object_id':'crm.phonecall'}</field>
28         </record>
29
30     <menuitem action="crm_phonecall_resource_act"
31         id="menu_crm_phonecall_resource_act"
32         parent="crm.menu_crm_case_resource_type" />
33
34
35 <!--  PhoneCalls Tree View -->
36
37     <record model="ir.ui.view" id="crm_case_phone_tree_view">
38         <field name="name">CRM - Phone Calls Tree</field>
39         <field name="model">crm.phonecall</field>
40         <field name="type">tree</field>
41         <field name="arch" type="xml">
42
43             <tree string="Phone Calls" colors="grey:state in ('cancel','done');blue:state in ('pending',)">
44                 <field name="date" string="Date"/>
45                 <field name="name" string="Call Summary"/>
46                 <field name="partner_id" string="Partner"/>
47                 <field name="partner_contact"/>
48                 <field name="partner_phone"/>
49                 <field name="user_id"/>
50                 <button string="Opportunity"
51                     name="%(phonecall2opportunity_act)d"
52                     states="draft,open,pending"
53                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
54                 <button string="Meeting"
55                     states="draft,open,pending"
56                      name="action_make_meeting" type="object" />
57                 <field name="state"/>
58                 <button name="case_open" string="Open" states="draft,pending" type="object" icon="gtk-go-forward"/>
59                 <button name="case_close" string="Held" states="open,draft,pending" type="object" icon="gtk-jump-to"/>
60                 <button name="case_pending" string="Not Held" states="open" type="object" icon="gtk-media-pause"/>
61                 <button name="case_cancel" string="Cancel" states="draft,open,pending" type="object" icon="gtk-cancel"/>
62             </tree>
63         </field>
64     </record>
65
66 <!-- Phonecalls Form View -->
67
68     <record model="ir.ui.view" id="crm_case_phone_form_view">
69         <field name="name">CRM - Phone Call Form</field>
70         <field name="model">crm.phonecall</field>
71         <field name="type">form</field>
72         <field name="arch" type="xml">
73             <form string="Phone Call">
74                 <group colspan="4" col="7">
75                     <field name="name" string="Summary"/>
76                     <field name="date" string="Planned Date"/>
77                     <field name="user_id"/>
78                     <button string="Schedule a Meeting"
79                         name="action_make_meeting"
80                         icon="gtk-redo"
81                         type="object" />
82
83                     <field name="partner_phone"/>
84                     <field name="duration"/>
85                     <field name="section_id" colspan="1" widget="selection" />
86                     <button string="Convert to Opportunity"
87                         name="%(phonecall2opportunity_act)d"
88                         icon="gtk-index" type="action"
89                         attrs="{'invisible':[('opportunity_id','!=',False)]}" />
90                     <label colspan="6"  string=""/>
91                     <button string="Schedule Other Call"
92                      icon="gtk-redo"
93                     name="%(phonecall_to_phonecall_act)d"
94                     type="action"  />
95
96                 </group>
97                 <group col="3" colspan="2">
98                     <separator colspan="3" string="Contacts" />
99                     <field name="partner_id"
100                         on_change="onchange_partner_id(partner_id, email_from)" />
101                     <button string="Create a Partner"
102                         icon="terp-crm"
103                         name="%(action_crm_phonecall2partner)d"
104                         type="action"
105                         attrs="{'invisible':[('partner_id','!=',False)]}" />
106                     <newline/>
107                     <field name="partner_address_id" string="Contact"
108                         on_change="onchange_partner_address_id(partner_address_id, email_from)" />
109                     <newline/>
110                     <field name="partner_mobile" />
111                 </group>
112                 <group col="2" colspan="2">
113                     <separator colspan="2" string="Categorization" />
114                     <field name="priority"/>
115                     <field name="opportunity_id"/>
116                 </group>
117                 <separator string="Description" colspan="4" />
118                 <field name="description" nolabel="1" colspan="4" />
119                 <separator colspan="4" />
120                 <group col="8" colspan="4">
121                     <field name="state" select="1" />
122                     <button name="case_cancel" string="Cancel"
123                         states="draft,open,pending" type="object"
124                         icon="gtk-cancel" />
125                     <button name="case_open" string="Open"
126                         states="draft,pending" type="object"
127                         icon="gtk-go-forward" />
128                     <button name="case_pending" string="Not Held"
129                         states="open" type="object" icon="gtk-undo" />
130                     <button name="case_close" string="Held"
131                         states="open,draft,pending" type="object"
132                         icon="gtk-jump-to" />
133                     <button name="case_reset" string="Reset to Draft"
134                         states="done,cancel" type="object"
135                         icon="gtk-convert" />
136                 </group>
137             </form>
138         </field>
139     </record>
140         
141         <!--Inbound Phonecalls Form View -->
142
143         <record model="ir.ui.view" id="crm_case_inbound_phone_form_view">
144         <field name="name">CRM - Inbound Phone Call Form</field>
145         <field name="model">crm.phonecall</field>
146         <field name="type">form</field>
147         <field name="arch" type="xml">
148             <form string="Phone Call">
149                 <group colspan="4" col="7">
150                     <field name="name" string="Summary"/>
151                     <field name="date" string="Planned Date"/>
152                     <field name="user_id"/>
153                     <button string="Schedule a Meeting"
154                         name="action_make_meeting"
155                         icon="gtk-redo"
156                         type="object" />
157
158                     <field name="partner_phone"/>
159                     <field name="duration"/>
160                     <field name="section_id" colspan="1" widget="selection" />
161                     <button string="Convert to Opportunity"
162                         name="%(phonecall2opportunity_act)d"
163                         icon="gtk-index" type="action"
164                         attrs="{'invisible':[('opportunity_id','!=',False)]}" />
165                     <label colspan="6"  string=""/>
166                     <button string="Schedule Other Call"
167                      icon="gtk-redo"
168                     name="%(phonecall_to_phonecall_act)d"
169                     type="action"  />
170
171                 </group>
172                 <group col="3" colspan="2">
173                     <separator colspan="3" string="Contacts" />
174                     <field name="partner_id"
175                         on_change="onchange_partner_id(partner_id, email_from)" />
176                     <button string="Create a Partner"
177                         icon="terp-crm"
178                         name="%(action_crm_phonecall2partner)d"
179                         type="action"
180                         attrs="{'invisible':[('partner_id','!=',False)]}" />
181                     <newline/>
182                     <field name="partner_address_id" string="Contact"
183                         on_change="onchange_partner_address_id(partner_address_id, email_from)" />
184                     <newline/>
185                     <field name="partner_phone" />
186                     <newline/>
187                     <field name="partner_mobile" />
188                 </group>
189                 <group col="2" colspan="2">
190                     <separator colspan="2" string="Categorization" />
191                     <field name="priority"/>
192                     <field name="opportunity_id"/>
193                 </group>
194                 <separator string="Description" colspan="4" />
195                 <field name="description" nolabel="1" colspan="4" />
196                 <separator colspan="4" />
197             </form>
198         </field>
199     </record>
200     
201     <!--Inbound Phonecalls Tree View -->
202     
203     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
204         <field name="name">CRM - Inbound Phone Calls Tree</field>
205         <field name="model">crm.phonecall</field>
206         <field name="type">tree</field>
207         <field name="arch" type="xml">
208             <tree string="Phone Calls" colors="grey:state in ('cancel','done');blue:state in ('pending',)">
209                 <field name="date" string="Date"/>
210                 <field name="name" string="Call Summary"/>
211                 <field name="partner_id" string="Partner"/>
212                 <field name="partner_contact"/>
213                 <field name="partner_phone"/>
214                 <field name="user_id"/>
215                 <field name="state" invisible="1"/>
216                 <button string="Opportunity"
217                     name="%(phonecall2opportunity_act)d"
218                     states="draft,open,pending"
219                     icon="gtk-convert"
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="gtk-home" string="Today"
252                    domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),\
253                     ('date','&gt;=',datetime.strftime('%%Y-%%m-%%d 00:00:00'))]"
254                    help="Todays's Phonecalls"
255                />
256                <filter icon="gtk-media-rewind"
257                    string="7 Days"
258                    help="Phonecalls during last 7 days"
259                    domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d')),\
260                     ('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
261                />
262                <separator orientation="vertical"/>
263                <field name="name" string="Call Summary"/>
264                <field name="partner_id"/>
265                <field name="user_id" widget="selection">
266                    <filter icon="terp-partner"
267                        domain="[('user_id','=',uid)]" help="My Phonecalls"
268                        default="1" />
269                    <filter icon="terp-partner"
270                        domain="[('user_id','=',False)]"
271                        help="Unassigned Phonecalls" />
272                </field>
273                <field name="section_id"
274                    select="1" widget="selection" string="Sales Team">
275                    <filter icon="terp-crm"
276                        domain="[('section_id','=',context.get('section_id',False))]"
277                        help="My section" />
278                </field>
279                <newline/>
280                <group expand="0" string="Group By..." colspan="4">
281                    <filter string="Partner" icon="terp-crm" domain="[]"
282                        context="{'group_by':'partner_id'}" />
283                    <filter string="Responsible" icon="terp-crm"
284                        domain="[]" context="{'group_by':'user_id'}" />
285                    <separator orientation="vertical" />
286                    <filter string="Creation" icon="terp-project"
287                        domain="[]" context="{'group_by':'create_date'}" />
288                    <filter string="Date" icon="terp-project" domain="[]"
289                        context="{'group_by':'date'}" />
290                </group>
291            </search>
292         </field>
293     </record>
294     
295     </data>
296 </openerp>