Forward port of branch 7.0 up to 1933e92
[odoo/odoo.git] / addons / crm / crm_phonecall_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5
6     <!-- Phonecall Categories Form View  -->
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" eval="{'object_id': ref('model_crm_phonecall')}"/>
14         <field name="help" type="html">
15           <p class="oe_view_nocontent_create">
16             Click to add a new category.
17           </p><p>
18             Create specific phone call categories to better define the type of
19             calls tracked in the system.
20           </p>
21         </field>
22     </record>
23
24     <menuitem action="crm_phonecall_categ_action" name="Categories"
25         id="menu_crm_case_phonecall-act" parent="menu_crm_config_phonecall" groups="base.group_no_one"/>
26
27     <!-- Phonecalls Tree View -->
28     <record model="ir.ui.view" id="crm_case_phone_tree_view">
29         <field name="name">CRM - Phone Calls Tree</field>
30         <field name="model">crm.phonecall</field>
31         <field name="arch" type="xml">
32             <tree colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
33                 <field name="date"/>
34                 <field name="name"/>
35                 <field name="partner_id"/>
36                 <button string="Meeting"
37                     states="open,pending"
38                     name="action_make_meeting"
39                     icon="gtk-redo"
40                     type="object"/>
41                 <button string="Convert to Opportunity"
42                     type="object"
43                     name="action_button_convert2opportunity"
44                     states="open,pending"
45                     icon="gtk-index"
46                     attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
47                 <field name="partner_phone"/>
48                 <field name="user_id"/>
49                 <field name="categ_id" invisible="1"/>
50                 <field name="create_date" invisible="1"/>
51                 <field name="opportunity_id" invisible="1"/>
52                 <field name="state"/>
53             </tree>
54         </field>
55     </record>
56
57     <!-- Phonecalls Form View -->
58     <record model="ir.ui.view" id="crm_case_phone_form_view">
59         <field name="name">CRM - Phone Call Form</field>
60         <field name="model">crm.phonecall</field>
61         <field name="arch" type="xml">
62             <form string="Phone Call" version="7.0">
63                 <header>
64                     <field name="state" nolabel="1" widget="statusbar" clickable="True"/>
65                 </header>
66                 <sheet string="Phone Call">
67                     <div class="oe_right">
68                         <button string="Convert to Opportunity"
69                             type="object"
70                             name="action_button_convert2opportunity"
71                             attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state', 'not in', ('open', 'done'))]}"/>
72                         <button string="Schedule Other Call"
73                                 name="%(phonecall_to_phonecall_act)d"
74                                 type="action"/>
75                         <button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
76                     </div>
77                     <div class="oe_title">
78                         <div class="oe_edit_only">
79                             <label for="name"/>
80                         </div>
81                         <h1><field name="name" required="1"/></h1>
82                         <div class="oe_edit_only">
83                             <label for="partner_phone" string="Phone"/>
84                         </div>
85                         <h2><field name="partner_phone"/></h2>
86                     </div>
87
88                     <group col="4">
89                         <field name="date"/>
90                         <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_salesman_all_leads']}"/>
91                         <label for="duration"/>
92                         <div>
93                                 <field name="duration" widget="float_time" class="oe_inline" style="vertical-align:baseline"/> <b> min(s)</b>
94                         </div>
95                         <field name="section_id" colspan="1" widget="selection"
96                                 groups="base.group_multi_salesteams"/>
97                         <field name="partner_id" on_change="on_change_partner_id(partner_id)"/>
98                         <field name="categ_id" widget="selection"
99                             domain="[('object_id.model', '=', 'crm.phonecall')]"/>
100                         <field name="partner_mobile"/>
101                         <field name="priority"/>
102                         <field name="opportunity_id" on_change="on_change_opportunity(opportunity_id)" context="{'opportunity_id': opportunity_id}"/>
103                     </group>
104                     <field name="description" placeholder="Description..."/>
105                 </sheet>
106                 <div class="oe_chatter">
107                     <field name="message_follower_ids" widget="mail_followers"/>
108                     <field name="message_ids" widget="mail_thread"/>
109                 </div>
110             </form>
111         </field>
112     </record>
113
114     <!--Logged Phonecalls Tree View -->
115     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
116         <field name="name">CRM - Logged Phone Calls Tree</field>
117         <field name="model">crm.phonecall</field>
118         <field name="arch" type="xml">
119             <tree string="Phone Calls" editable="top">
120                 <field name="date"/>
121                 <field name="name"/>
122                 <field name="partner_id"
123                     on_change="on_change_partner_id(partner_id)"/>
124                 <field name="partner_phone"
125                     invisible="1"/>
126                 <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_salesman_all_leads']}"/>
127                 <field name="categ_id" widget="selection"
128                     domain="[('object_id.model', '=', 'crm.phonecall')]"
129                     invisible="1"/>
130                 <field name="state" invisible="1"/>
131                 <field name="create_date" invisible="1"/>
132                 <field name="opportunity_id" invisible="1" on_change="on_change_opportunity(opportunity_id)"/>
133                 <button string="Schedule Other Call"
134                     icon="terp-call-start"
135                     name="%(phonecall_to_phonecall_act)d"
136                     type="action"/>
137                 <button string="Meeting"
138                      icon="gtk-redo"
139                      name="action_make_meeting" type="object"/>
140                 <button string="Convert to Opportunity"
141                     name="action_button_convert2opportunity"
142                     states="open,pending"
143                     icon="gtk-index"
144                     type="object" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
145             </tree>
146         </field>
147     </record>
148
149     <!-- Phonecalls Calendar View -->
150     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
151         <field name="name">CRM - Phone Calls Calendar</field>
152         <field name="model">crm.phonecall</field>
153         <field name="priority" eval="2"/>
154         <field name="arch" type="xml">
155             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
156                 <field name="name"/>
157                 <field name="partner_id"/>
158             </calendar>
159         </field>
160     </record>
161
162     <!-- Phonecalls Search View  -->
163     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
164         <field name="name">CRM - Phone Calls Search</field>
165         <field name="model">crm.phonecall</field>
166         <field name="arch" type="xml">
167             <search string="Search Phonecalls">
168                <field name="name" string="Phonecalls"/>
169                <field name="date"/>
170                <field name="state"/>
171                <separator/>
172                <filter icon="terp-gtk-go-back-rtl" string="To Do" name="current" domain="[('state','=','open')]"/>
173                <separator/>
174                <filter string="Unassigned Phonecalls" icon="terp-personal-" domain="[('user_id','=',False)]" help="Unassigned Phonecalls"/>
175                <filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
176                <separator/>
177                <filter string="Phone Calls Assigned to Me or My Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('user_id', '=', uid)]"
178                        help="Phone Calls Assigned to the current user or with a team having the current user as team leader"/>
179                <field name="partner_id" operator="child_of"/>
180                <field name="user_id"/>
181                <field name="section_id" string="Sales Team"
182                         groups="base.group_multi_salesteams"/>
183                <group expand="0" string="Group By...">
184                    <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
185                    <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
186                    <filter string="Creation" icon="terp-go-month" help="Creation Date" domain="[]" context="{'group_by':'create_date'}"/>
187                    <filter string="Calls Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}" help="Calls Date by Month"/>
188                </group>
189            </search>
190         </field>
191     </record>
192
193     </data>
194 </openerp>