[MERGE] forward port of branch saas-3 up to fe8106f
[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">
63                 <header>
64                     <field name="state" nolabel="1" widget="statusbar" clickable="True"/>
65                 </header>
66                 <sheet string="Phone Call">
67                     <div class="oe_right oe_button_box">
68                         <button class="oe_inline oe_stat_button" type="object" name="action_button_convert2opportunity" 
69                             icon="fa-star" attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state', 'not in', ('open', 'done'))]}"
70                             help="Convert To Opportunity">
71                             <div>Convert To<br/>Opportunity</div>
72                         </button>
73
74                         <button class="oe_inline oe_stat_button" type="action" 
75                             name="%(phonecall_to_phonecall_act)d" icon="fa-phone">
76                             <div>Schedule<br/>Other Call</div>
77                         </button>
78                         <button class="oe_inline oe_stat_button" name="action_make_meeting" type="object" icon="fa-calendar fa-fw">
79                             <div>Schedule<br/>A Meeting</div>
80                         </button>
81                     </div>
82                     <div class="oe_title">
83                         <div class="oe_edit_only">
84                             <label for="name"/>
85                         </div>
86                         <h1><field name="name" required="1"/></h1>
87                         <div class="oe_edit_only">
88                             <label for="partner_phone" string="Phone"/>
89                         </div>
90                         <h2><field name="partner_phone"/></h2>
91                     </div>
92
93                     <group col="4">
94                         <field name="date"/>
95                         <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_salesman_all_leads']}"/>
96                         <label for="duration"/>
97                         <div>
98                                 <field name="duration" widget="float_time" class="oe_inline" style="vertical-align:baseline"/> <b> min(s)</b>
99                         </div>
100                         <field name="section_id" colspan="1" widget="selection"
101                                 groups="base.group_multi_salesteams"/>
102                         <field name="partner_id" on_change="on_change_partner_id(partner_id)"/>
103                         <field name="categ_id" widget="selection"
104                             domain="[('object_id.model', '=', 'crm.phonecall')]"/>
105                         <field name="partner_mobile"/>
106                         <field name="priority" widget="priority"/>
107                         <field name="opportunity_id" on_change="on_change_opportunity(opportunity_id)" context="{'opportunity_id': opportunity_id}"/>
108                     </group>
109                     <field name="description" placeholder="Description..."/>
110                 </sheet>
111                 <div class="oe_chatter">
112                     <field name="message_follower_ids" widget="mail_followers"/>
113                     <field name="message_ids" widget="mail_thread"/>
114                 </div>
115             </form>
116         </field>
117     </record>
118
119     <!--Logged Phonecalls Tree View -->
120     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
121         <field name="name">CRM - Logged Phone Calls Tree</field>
122         <field name="model">crm.phonecall</field>
123         <field name="arch" type="xml">
124             <tree string="Phone Calls" editable="top">
125                 <field name="date"/>
126                 <field name="name"/>
127                 <field name="partner_id"
128                     on_change="on_change_partner_id(partner_id)"/>
129                 <field name="partner_phone"
130                     invisible="1"/>
131                 <field name="user_id" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'base.group_sale_salesman_all_leads']}"/>
132                 <field name="categ_id" widget="selection"
133                     domain="[('object_id.model', '=', 'crm.phonecall')]"
134                     invisible="1"/>
135                 <field name="state" invisible="1"/>
136                 <field name="create_date" invisible="1"/>
137                 <field name="opportunity_id" invisible="1" on_change="on_change_opportunity(opportunity_id)"/>
138                 <button string="Schedule Other Call"
139                     icon="terp-call-start"
140                     name="%(phonecall_to_phonecall_act)d"
141                     type="action"/>
142                 <button string="Meeting"
143                      icon="gtk-redo"
144                      name="action_make_meeting" type="object"/>
145                 <button string="Convert to Opportunity"
146                     name="action_button_convert2opportunity"
147                     states="open,pending"
148                     icon="gtk-index"
149                     type="object" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
150             </tree>
151         </field>
152     </record>
153
154     <!-- Phonecalls Calendar View -->
155     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
156         <field name="name">CRM - Phone Calls Calendar</field>
157         <field name="model">crm.phonecall</field>
158         <field name="priority" eval="2"/>
159         <field name="arch" type="xml">
160             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
161                 <field name="name"/>
162                 <field name="partner_id"/>
163             </calendar>
164         </field>
165     </record>
166
167     <!-- Phonecalls Search View  -->
168     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
169         <field name="name">CRM - Phone Calls Search</field>
170         <field name="model">crm.phonecall</field>
171         <field name="arch" type="xml">
172             <search string="Search Phonecalls">
173                 <field name="name" string="Phonecalls"/>
174                 <field name="date"/>
175                 <field name="state"/>
176                 <filter string="My Phonecalls" domain="[('user_id', '=', uid)]"/>
177                 <filter string="My Team" domain="[('section_id.user_id', '=', uid)]"/>
178                 <filter string="Unassigned" domain="[('user_id','=',False)]"/>
179                 <separator/>
180                 <filter string="To Do" name="current" domain="[('state','=','open')]"/>
181                 <separator/>
182                 <filter string="New Mail" name="message_unread" domain="[('message_unread','=',True)]"/>
183                 <separator/>
184                 <field name="partner_id" operator="child_of"/>
185                 <field name="user_id"/>
186                 <field name="opportunity_id"/>
187                 <field name="section_id" string="Sales Team"
188                         groups="base.group_multi_salesteams"/>
189                 <group expand="0" string="Group By">
190                     <filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
191                     <filter string="Responsible" domain="[]" context="{'group_by':'user_id'}"/>
192                     <filter string="Creation" help="Creation Date" domain="[]" context="{'group_by':'create_date'}"/>
193                     <filter string="Month" domain="[]" context="{'group_by':'date'}" help="Calls Date by Month"/>
194                 </group>
195             </search>
196         </field>
197     </record>
198
199     </data>
200 </openerp>