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