[MERGE] lp:~openerp-commiter/openobject-addons/trunk-red-button-crm-aja
[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" eval="{'object_id': ref('model_crm_phonecall')}"/>
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" groups="base.group_no_one"/>
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 fonts="bold:needaction_pending==True" colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
28                 <field name="needaction_pending" invisible="1"/>
29                 <field name="date"/>
30                 <field name="name"/>
31                 <field name="partner_id"/>
32                 <field name="partner_phone"/>
33                 <field name="user_id"/>
34                 <field name="categ_id" invisible="1"/>
35                 <field name="create_date" invisible="1"/>
36                 <field name="opportunity_id" invisible="1"/>
37                 <button string="Convert to Opportunity"
38                     name="%(phonecall2opportunity_act)d"
39                     states="open,pending"
40                     icon="gtk-index"
41                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
42                 <button string="Meeting"
43                     states="open,pending" icon="gtk-redo"
44                      name="action_make_meeting" type="object" />
45                 <field name="state"/>
46                 <button name="case_open" string="Confirm" type="object"
47                         states="draft,pending" icon="gtk-go-forward"/>
48                 <button name="case_close" string="Held" type="object"
49                         states="open,pending" icon="gtk-jump-to"/>
50                 <button name="case_cancel" string="Cancel" type="object"
51                         states="draft,open,pending" icon="gtk-cancel"/>
52                 <button name="case_reset" string="Reset to Todo" type="object"
53                         states="cancel" icon="gtk-convert"/>
54             </tree>
55         </field>
56     </record>
57
58 <!-- Phonecalls Form View -->
59
60     <record model="ir.ui.view" id="crm_case_phone_form_view">
61         <field name="name">CRM - Phone Call Form</field>
62         <field name="model">crm.phonecall</field>
63         <field name="type">form</field>
64         <field name="arch" type="xml">
65             <form version="7.0">
66             <header>
67                 <button name="case_open" string="Confirm" type="object" class="oe_form_button_active_flow"
68                         states="draft,pending" icon="gtk-go-forward"/>
69                 <button name="case_close" string="Held" type="object" class="oe_form_button_active_flow"
70                         states="open,pending" icon="gtk-jump-to"/>
71                 <button name="case_reset" string="Reset to Todo" type="object"
72                         states="cancel" icon="gtk-convert"/>
73                 <button name="case_cancel" string="Cancel" type="object"
74                         states="draft,open,pending" icon="gtk-cancel"/>
75                 <button string="Convert to Opportunity"  class="oe_form_button_active_flow"
76                     name="%(phonecall2opportunity_act)d"
77                     icon="gtk-index" type="action"
78                     attrs="{'invisible':[('opportunity_id','!=',False)]}" />
79                 <button string="Schedule Other Call"
80                     icon="terp-call-start"
81                     name="%(phonecall_to_phonecall_act)d"
82                     type="action"  />
83                 <button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
84                 <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,done"/>
85             </header>
86             <sheet string="Phone Call">
87                  <group col="4">
88                     <field name="name" required="1"/>
89                     <field name="partner_phone"/>
90                     <field name="duration" widget="float_time"/>
91
92                     <field name="date"/>
93                     <field name="user_id"/>
94                     <field name="section_id" colspan="1" widget="selection" />
95                 </group>
96
97                 <group>
98                     <group string="Contacts">
99                         <field name="partner_id"
100                             on_change="onchange_partner_id(partner_id)" />
101                         <field name="partner_mobile"/>
102                     </group>
103                     <group string="Categorization">
104                         <field name="categ_id" widget="selection"
105                             domain="[('object_id.model', '=', 'crm.phonecall')]"/>
106                         <field name="priority"/>
107                         <field name="opportunity_id"/>
108                     </group>
109                 </group>
110                 <separator string="Description"/>
111                 <field name="description"/>
112             </sheet>
113             <footer>
114                 <field name="message_ids" widget="ThreadView"/>
115             </footer>
116             </form>
117         </field>
118     </record>
119
120     <!--Logged Phonecalls Tree View -->
121
122     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
123         <field name="name">CRM - Logged Phone Calls Tree</field>
124         <field name="model">crm.phonecall</field>
125         <field name="type">tree</field>
126         <field name="arch" type="xml">
127             <tree string="Phone Calls" fonts="bold:needaction_pending==True" editable="top">
128                 <field name="needaction_pending" invisible="1"/>
129                 <field name="date"/>
130                 <field name="name"/>
131                 <field name="partner_id"
132                     on_change="onchange_partner_id(partner_id)"
133                     string="Partner" />
134                 <field name="partner_phone"
135                     invisible="1"/>
136                 <field name="user_id"/>
137                 <field name="categ_id" widget="selection"
138                     domain="[('object_id.model', '=', 'crm.phonecall')]"
139                     invisible="1"/>
140                 <field name="state" invisible="1"/>
141                 <field name="create_date" invisible="1"/>
142                 <field name="opportunity_id" invisible="1"/>
143                 <button string="Schedule Other Call"
144                     icon="terp-call-start"
145                     name="%(phonecall_to_phonecall_act)d"
146                     type="action"  />
147                 <button string="Meeting"
148                      icon="gtk-redo"
149                      name="action_make_meeting" type="object" />
150                 <button string="Convert to Opportunity"
151                     name="%(phonecall2opportunity_act)d"
152                     states="open,pending"
153                     icon="gtk-index"
154                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
155             </tree>
156         </field>
157     </record>
158
159 <!-- Phonecalls Calendar View -->
160
161     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
162         <field name="name">CRM - Phone Calls Calendar</field>
163         <field name="model">crm.phonecall</field>
164         <field name="type">calendar</field>
165         <field name="priority" eval="2"/>
166         <field name="arch" type="xml">
167             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
168                 <field name="name"/>
169                 <field name="partner_id"/>
170             </calendar>
171         </field>
172     </record>
173
174 <!-- Phonecalls Search View  -->
175
176     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
177         <field name="name">CRM - Phone Calls Search</field>
178         <field name="model">crm.phonecall</field>
179         <field name="type">search</field>
180         <field name="arch" type="xml">
181             <search string="Search Phonecalls">
182                <filter icon="terp-go-today" string="Today"
183                    domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),
184                     ('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]"
185                    name="today"
186                    help="Todays's Phonecalls"
187                />
188                <filter icon="terp-go-week"
189                    string="7 Days"
190                    help="Phonecalls during last 7 days"
191                    domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
192                />
193
194                <separator orientation="vertical"/>
195                <field name="name"/>
196                <field name="partner_id"/>
197                <field name="user_id">
198                    <filter icon="terp-personal-"
199                        domain="[('user_id','=',False)]"
200                        help="Unassigned Phonecalls" />
201                </field>
202                <field name="section_id"
203                    widget="selection" string="Sales Team">
204                    <filter icon="terp-personal+"
205                        domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
206                        help="My Sales Team(s)" />
207                </field>
208                <newline/>
209                <group expand="0" string="Group By...">
210                    <filter string="Partner" icon="terp-partner" domain="[]"
211                        context="{'group_by':'partner_id'}" />
212                    <filter string="Responsible" icon="terp-personal"
213                        domain="[]" context="{'group_by':'user_id'}" />
214                    <separator orientation="vertical" />
215                    <filter string="Creation" icon="terp-go-month" help="Creation Date"
216                        domain="[]" context="{'group_by':'create_date'}" />
217                    <filter string="Date" icon="terp-go-month" domain="[]"
218                        context="{'group_by':'date'}" help="Date of Call" />
219                </group>
220            </search>
221         </field>
222     </record>
223     <!-- Scheduled a phonecall search view-->
224     <record id="view_crm_case_scheduled_phonecalls_filter" model="ir.ui.view">
225         <field name="name">CRM - Scheduled Calls Search</field>
226         <field name="model">crm.phonecall</field>
227         <field name="type">search</field>
228         <field name="arch" type="xml">
229             <search string="Scheduled Phonecalls">
230                <filter icon="terp-gtk-go-back-rtl" string="To Do" name="current" domain="[('state','=','open')]"/>
231                <separator orientation="vertical"/>
232                <filter icon="terp-go-today" string="Today"
233                    domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),
234                     ('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]"
235                    name="today"
236                    help="Todays's Phonecalls"
237                />
238                <filter icon="terp-go-week"
239                    string="7 Days"
240                    help="Phonecalls during last 7 days"
241                    domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
242                />
243
244                <separator orientation="vertical"/>
245                <field name="name"/>
246                <field name="partner_id"/>
247                <field name="user_id">
248                    <filter icon="terp-personal-"
249                        domain="[('user_id','=',False)]"
250                        help="Unassigned Phonecalls" />
251                </field>
252                <field name="section_id"
253                    widget="selection" string="Sales Team">
254                    <filter icon="terp-personal+"
255                        domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
256                        help="My Sales Team(s)" />
257                </field>
258                <newline/>
259                <group expand="0" string="Group By...">
260                    <filter string="Partner" icon="terp-partner" domain="[]"
261                        context="{'group_by':'partner_id'}" />
262                    <filter string="Responsible" icon="terp-personal"
263                        domain="[]" context="{'group_by':'user_id'}" />
264                    <separator orientation="vertical" />
265                    <filter string="Creation" icon="terp-go-month" help="Creation Date"
266                        domain="[]" context="{'group_by':'create_date'}" />
267                    <filter string="Date" icon="terp-go-month" domain="[]"
268                        context="{'group_by':'date'}" help="Date of Call" />
269                </group>
270            </search>
271         </field>
272     </record>
273
274     </data>
275 </openerp>