[IMP] base_calendar : Improved the Search View.
[odoo/odoo.git] / addons / base_calendar / base_calendar_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <!-- Attendee form view-->
5
6         <record id="base_calendar_attendee_form_view" model="ir.ui.view">
7             <field name="name">calendar.attendee.form</field>
8             <field name="model">calendar.attendee</field>
9             <field name="type">form</field>
10             <field name="arch" type="xml">
11                 <form string="Invitation details" version="7.0">
12                     <header>
13                         <button name="do_tentative"
14                             states="needs-action,declined,accepted"
15                             string="Uncertain" type="object"/>
16                         <button name="do_accept" string="Accept"
17                             states="needs-action,tentative,declined"
18                             type="object" />
19                         <button
20                             name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
21                             string="Delegate" type="action"
22                             states="needs-action,tentative,declined,accepted"
23                             context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
24                         <button name="do_decline" string="Decline"
25                             states="needs-action,tentative,accepted"
26                             type="object" />
27                         <field name="state" widget="statusbar"
28                             statusbar_visible="tentative,needs-action,accepted" statusbar_colors='{"proforma":"blue"}'/>
29                     </header>
30                     <sheet>
31
32                         <div class="oe_form_title">
33                             <label for="email" string="Invitation To" class="oe_form_readonly_hidden" /> 
34                             <h1>
35                                 <field name="email" class="oe_form_inline" />
36                                 (<field name="language" class="oe_form_inline" />)
37                             </h1>
38                             
39                             <h2>
40                                 From <field name="event_date" class="oe_form_inline" />
41                                 to <field name="event_end_date" class="oe_form_inline"/>
42                             </h2>
43                         </div>
44                         <group>
45                             <group>
46                                 <field name="sent_by_uid" string="Invitation From" />
47                                 <field name="user_id" string="Invited User"/>
48                                 <field name="partner_id" string="Contact" />
49                             </group>
50                             <group>
51                                 <field name="cutype" string="Invitation Type" />
52                                 <field name="role" string="Role" />
53                                 <field name="rsvp" />
54                                 <field name="ref" readonly="1"/>
55                             </group>
56                         </group>
57                         <group>
58                             <group string="Delegrated From">
59                                 <field name="parent_ids" readonly="1" nolabel="1" />
60                             </group>
61                             <group string="Delegrated To" >
62                                 <field name="child_ids" readonly="1" nolabel="1" />
63                             </group>
64                         </group>
65                     </sheet>
66                 </form>
67             </field>
68         </record>
69
70         <!--        Attendee tree view-->
71
72         <record id="base_calendar_attendee_tree_view" model="ir.ui.view">
73             <field name="name">calendar.attendee.tree</field>
74             <field name="model">calendar.attendee</field>
75             <field name="type">tree</field>
76             <field name="arch" type="xml">
77                 <tree string="Invitation details">
78                     <field name="sent_by_uid" string="Invitation From" />
79                     <field name="role" string="My Role"/>
80                     <field name="user_id" invisible="1"/>
81                     <field name="partner_id" invisible="1"/>
82                     <field name="cutype" string="Invitation Type"/>
83                     <field name="state" />
84                     <field name="rsvp" string="Required to Join"/>
85                 </tree>
86             </field>
87         </record>
88
89         <!--        Attendee search view-->
90
91         <record id="base_calendar_attendee_search_view" model="ir.ui.view">
92             <field name="name">calendar.attendee.search</field>
93             <field name="model">calendar.attendee</field>
94             <field name="type">search</field>
95             <field name="arch" type="xml">
96                 <search string="Search Invitations">
97                    <field name="email"
98                    filter_domain="[('email','ilike',self)]"
99                    string="Email"/>
100                    <field name="event_date"/>
101                    <separator orientation="vertical"/>
102                    <filter icon="terp-gtk-jump-to-ltr" name="toreview" string="To Review"
103                        domain="[('state','=', 'needs-action')]"
104                        help="Invitations To Review" />
105                    <filter icon="terp-check" string="Accepted"
106                        domain="[('state','=', 'accepted')]"
107                        help="Accepted Invitations" />
108                    <filter icon="terp-dialog-close" string="Declined"
109                        domain="[('state','=', 'declined')]"
110                        help="Declined Invitations" />
111                    <filter icon="gtk-sort-descending" string="Delegated"
112                        domain="[('state','=', 'delegated')]"
113                        help="Delegated Invitations" />
114                    <separator orientation="vertical"/>
115                    <field name="user_id" string="Responsible"/>
116                    <separator orientation="vertical"/>
117                    <field name="cutype" string="Invitation type"/>
118                    <newline/>
119                     <group expand="0" string="Group By...">
120                         <filter string="Responsible" icon="terp-personal" domain="[]"
121                             context="{'group_by':'user_id'}" />
122                         <filter string="Contact" icon="terp-personal" domain="[]"
123                             context="{'group_by':'partner_id'}" />
124                         <separator orientation="vertical" />
125                         <filter string="Type" icon="terp-stock_symbol-selection" help="Invitation Type"
126                             domain="[]" context="{'group_by':'cutype'}" />
127                         <filter string="Role" icon="terp-gtk-select-all"
128                             domain="[]" context="{'group_by':'role'}" />
129                         <filter string="Required Reply" icon="terp-mail-replied"
130                             domain="[]" context="{'group_by':'rsvp'}" />
131                         <separator orientation="vertical" />
132                         <filter string="Status" icon="terp-stock_effects-object-colorize" help="Invitation Type"
133                             domain="[]" context="{'group_by':'state'}" />
134                     </group>
135                </search>
136             </field>
137         </record>
138         <record id="action_view_attendee_form" model="ir.actions.act_window">
139              <field name="name">Event Invitations</field>
140              <field name="type">ir.actions.act_window</field>
141              <field name="res_model">calendar.attendee</field>
142              <field name="view_type">form</field>
143              <field name="view_mode">tree,form</field>
144              <field name="view_id" ref="base_calendar.base_calendar_attendee_tree_view" />
145              <field name="context">{'default_sent_by_uid': uid}</field>
146          </record>
147
148         <!-- Calenadar's menu -->
149         <menuitem id="base.menu_calendar_configuration" name="Calendar"
150             parent="base.menu_base_config" sequence="50" groups="base.group_sale_manager" />
151
152         <!-- Invitation menu -->
153
154          <menuitem id="menu_attendee_invitations"
155             parent="base.menu_calendar_configuration"
156             sequence="10" action="action_view_attendee_form" />
157
158         <!--        ALARM FORM VIEW-->
159
160         <record id="res_alarm_form_view" model="ir.ui.view">
161             <field name="name">res.alarm.form</field>
162             <field name="model">res.alarm</field>
163             <field name="type">form</field>
164             <field name="arch" type="xml">
165                 <form string="Reminder details" version="7.0">
166                     <group col="4">
167                         <field name="name" />
168                         <field name="active" />
169                         <separator string="Reminder Details" colspan="4" />
170                         <field name="trigger_duration" />
171                         <field name="trigger_interval" />
172                         <field name="trigger_occurs" />
173                         <field name="trigger_related" />
174                     </group>
175                 </form>
176             </field>
177         </record>
178
179         <!--        ALARM TREE VIEW-->
180
181         <record id="res_alarm_tree_view" model="ir.ui.view">
182             <field name="name">res.alarm.tree</field>
183             <field name="model">res.alarm</field>
184             <field name="type">tree</field>
185             <field name="arch" type="xml">
186                 <tree string="Reminder details">
187                 <field name="name"/>
188                 <field name="trigger_interval"/>
189                 <field name="trigger_duration"/>
190                 <field name="trigger_occurs"/>
191                 <field name="trigger_related"/>
192                 </tree>
193             </field>
194         </record>
195         <record id="action_res_alarm_view" model="ir.actions.act_window">
196             <field name="name">Alarms</field>
197             <field name="type">ir.actions.act_window</field>
198             <field name="res_model">res.alarm</field>
199             <field name="view_type">form</field>
200             <field name="view_mode">tree,form</field>
201             <field name="help">Create specific calendar alarms that may be assigned to calendar events or meetings.</field>
202         </record>
203
204         <!--        Menu for Alarms-->
205
206          <menuitem id="menu_crm_meeting_avail_alarm"
207             groups="base.group_no_one"
208             action="base_calendar.action_res_alarm_view"
209             parent="base.menu_calendar_configuration" sequence="5"/>
210
211         <!-- Event Form View-->
212
213         <record model="ir.ui.view" id="event_form_view">
214             <field name="name">Event Form</field>
215             <field name="model">calendar.event</field>
216             <field name="type">form</field>
217             <field name="arch" type="xml">
218                 <form string="Events" version="7.0">
219                 <header>
220                     <button name="do_confirm"
221                         string="Confirm"
222                         states="tentative,cancelled"
223                         type="object"
224                         />
225                     <button name="do_tentative"
226                         states="confirmed,cancelled"
227                         string="Uncertain"
228                         type="object"
229                         />
230                     <button name="do_cancel"
231                         string="Cancel"
232                         states="tentative,confirmed"
233                         type="object"
234                         />
235                     <field name="state" widget="statusbar"
236                         statusbar_visible="tentative,confirmed" statusbar_colors='{"proforma":"blue"}'/>
237                 </header>
238                 <sheet>
239                     <group col="6">
240                         <field name="name" string="Summary"
241                             colspan="4" required="1" />
242                         <field name="allday" colspan="2" on_change="onchange_dates(date,False,False,allday)" />
243                         <newline/>
244                         <field name="date" string="Start Date" required="1"
245                             on_change="onchange_dates(date,duration,False,allday)" />
246                         <field name="duration" widget="float_time"
247                             on_change="onchange_dates(date,duration,False,allday)" attrs="{'invisible': [('allday', '=', True)]}"/>
248                         <field name="date_deadline" string="End Date" required="1"
249                             on_change="onchange_dates(date,False,date_deadline)" />
250                         <field name="location" />
251                         <field name="alarm_id" string="Reminder"
252                             widget="selection" />
253                         <group colspan="2" col="4" attrs="{'readonly': [('state','=','done')]}">
254                            <field name="recurrency"/>
255                         </group>
256                     </group>
257                     <notebook>
258                     <page string="Event">
259                         <group col="6" colspan="4">
260                              <separator colspan="6" string="Visibility"/>
261                              <field name="user_id" string="Responsible User" />
262                              <field name="show_as" string="Show Time as"/>
263                              <field name="class" string="Privacy"/>
264                              <field name="recurrent_id" invisible="1" />
265                              <field name="recurrent_uid" invisible="1" />
266                         </group>
267                         <separator string="Description"/>
268                         <field name="description"/>
269                     </page>
270                     <page string="Invitation Detail">
271                         <button string="Invite People"
272                             name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
273                             icon="terp-partner" type="action"
274                             context="{'model' : 'calendar.event', 'attendee_field':'attendee_ids'}" colspan="2"/>
275                         <field name="attendee_ids" colspan="4"
276                             nolabel="1" widget="one2many" mode="tree,form">
277                             <tree string="Invitation details" editable="top">
278                                 <field name="sent_by_uid" string="From"/>
279                                 <field name="user_id" string="To"/>
280                                 <field name="email" />
281                                 <field name="role" width="200" />
282                                 <field name="state" />
283                                 <button name="do_tentative"
284                                     states="needs-action,declined,accepted"
285                                     string="Uncertain" type="object"
286                                     icon="terp-crm" />
287                                 <button name="do_accept" string="Accept"
288                                     states="needs-action,tentative,declined"
289                                     type="object" icon="gtk-apply" />
290                                 <button name="do_decline" string="Decline"
291                                     states="needs-action,tentative,accepted"
292                                     type="object" icon="gtk-cancel" />
293                                 <button
294                                     name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
295                                     string="Delegate" type="action"
296                                     icon="gtk-sort-descending"
297                                     states="needs-action,tentative,declined,accepted"
298                                     context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
299                             </tree>
300                             <form string="Invitation details" version="7.0">
301                                 <notebook colspan="4">
302                                     <page string="Details">
303                                         <group col="4">
304                                             <field name="email" />
305                                             <field name="rsvp"/>
306                                             <field name="cutype"/>
307                                             <field name="role"/>
308                                         </group>
309                                         <group col="4">
310                                             <field name="state"/>
311                                             <button name="do_tentative"
312                                                 states="needs-action,declined,accepted"
313                                                 string="Uncertain"
314                                                 type="object"
315                                                 icon="terp-crm" />
316                                             <button name="do_accept"
317                                                 string="Accept"
318                                                 states="needs-action,tentative,declined"
319                                                 type="object"
320                                                 icon="gtk-apply" />
321                                             <button name="do_decline"
322                                                 string="Decline"
323                                                 states="needs-action,tentative,accepted"
324                                                 type="object"
325                                                 icon="gtk-cancel" />
326                                             <button
327                                                 name="%(base_calendar.action_view_calendar_invite_attendee_wizard)d"
328                                                 string="Delegate"
329                                                 type="action"
330                                                 icon="gtk-sort-descending"
331                                                 states="needs-action,tentative,declined,accepted"
332                                                 context="{'model' : 'calendar.attendee', 'attendee_field' : 'child_ids'}" />
333                                         </group>
334                                     </page>
335                                     </notebook>
336                                 </form>
337                             </field>
338                         </page>
339                     <page string="Recurrency Option" attrs="{'invisible': [('recurrency','=',False)]}">
340                         <group col="4" colspan="4" name="rrule">
341                             <group col="4" colspan="4">
342                                 <field name="rrule_type" string="Recurrency period"
343                                    attrs="{'readonly':[('recurrent_uid','!=',False)]}" />
344                                 <field name="interval" />
345                                 <separator string="End of Recurrence" colspan="4"/>
346                                 <field name="end_type" />
347                                 <label string=" " colspan="2" />
348                                 <newline />
349                                 <field name="count" attrs="{'invisible' : [('end_type', '!=', 'count')] }"/>
350                                 <label string=" " colspan="2" />
351                                 <newline />
352                                 <field name="end_date" attrs="{'invisible' : [('end_type', '!=', 'end_date')] }"/>
353                                 <newline />
354
355
356                             </group>
357                             <group col="8" colspan="4" name="Select weekdays" attrs="{'invisible' :[('rrule_type','not in', ['weekly'])]}">
358                                 <separator string="Choose day where repeat the meeting" colspan="8"/>
359                                 <field name="mo" colspan="1" />
360                                 <field name="tu" colspan="1" />
361                                 <field name="we" colspan="1" />
362                                 <field name="th" colspan="1" />
363                                 <newline/>
364                                 <field name="fr" colspan="1" />
365                                 <field name="sa" colspan="1"  />
366                                 <field name="su" colspan="1"  />
367                                 <newline />
368                             </group>
369                             <group col="10" colspan="4"
370                                 attrs="{'invisible' : [('rrule_type','!=','monthly')]}">
371                                 <separator string="Choose day in the month where repeat the meeting" colspan="12"/>
372                                 <group col="2" colspan="1">
373                                     <field name="select1" />
374                                 </group>
375                                 <group col="2" colspan="1">
376                                     <field name="day"
377                                         attrs="{'required' : [('select1','=','date'), ('rrule_type','=','monthly')],
378                                             'invisible' : ['|', ('select1','=','day'), ('rrule_type','!=','monthly')]}" />
379                                 </group>
380                                 <group col="3" colspan="1"
381                                     attrs="{'invisible' : ['|', ('select1','=','date'), ('rrule_type','!=','monthly')]}">
382                                     <field name="byday" string="The"
383                                         attrs="{'required' : [('select1','=','day'), ('rrule_type','=','monthly')]}" />
384                                     <field name="week_list" nolabel="1"
385                                         attrs="{'required' : [('select1','=','day'), ('rrule_type','=','monthly')]}" />
386                                 </group>
387                             </group>
388                         </group>
389
390                     </page>
391                     </notebook>
392                 </sheet>
393                 </form>
394             </field>
395         </record>
396
397         <!-- Event Tree View  -->
398
399         <record model="ir.ui.view" id="event_tree_view">
400             <field name="name">Event Tree</field>
401             <field name="model">calendar.event</field>
402             <field name="type">tree</field>
403             <field name="arch" type="xml">
404                 <tree string="Events">
405                     <field name="name" string="Subject" />
406                     <field name="date" string="Event Date" />
407                     <field name="location" />
408                     <field name="show_as" />
409                     <field name="class" string="Privacy" />
410                     <field name="user_id" invisible="1"/>
411                     <field name="state" invisible="1"/>
412                 </tree>
413             </field>
414         </record>
415
416         <!-- Event Calendar View  -->
417
418         <record model="ir.ui.view" id="event_calendar_view">
419             <field name="name">Events Calendar</field>
420             <field name="model">calendar.event</field>
421             <field name="type">calendar</field>
422             <field name="priority" eval="2"/>
423             <field name="arch" type="xml">
424                 <calendar string="Events" date_start="date" color="show_as" date_delay="duration">
425                     <field name="name"/>
426                     <field name="class"/>
427                     <field name="show_as"/>
428                 </calendar>
429             </field>
430         </record>
431
432         <!--     Event Search View-->
433
434         <record id="view_calendar_event_filter" model="ir.ui.view">
435             <field name="name">Calendar Events Search</field>
436             <field name="model">calendar.event</field>
437             <field name="type">search</field>
438             <field name="arch" type="xml">
439                 <search string="Search Events">
440                        <group>
441                            <field name="name"
442                            filter_domain="['|' ('name','ilike',self), ('location','ilike',self)]"
443                            string="Event"/>
444                            <separator orientation="vertical"/>
445                            <filter icon="terp-go-today" string="My Events"
446                                domain="[('user_id','=',uid)]"
447                                help="My Events" />
448                            <separator orientation="vertical"/>
449                            <filter icon="terp-check" string="Confirmed"
450                                domain="[('state','=','confirmed')]"
451                                help="Confirmed Events" />
452                            <separator orientation="vertical"/>
453                            <field name="user_id"/>
454                            <separator orientation="vertical"/>
455                            <field name="show_as"/>
456                            <field name="class" string="Privacy"/>
457                        </group>
458                        <newline/>
459                         <group expand="0" string="Group By...">
460                             <filter string="Responsible" icon="terp-personal" domain="[]"
461                                 context="{'group_by':'user_id'}" />
462                             <separator orientation="vertical" />
463                             <filter string="Availability" icon="terp-camera_test"
464                                 domain="[]" context="{'group_by':'show_as'}" />
465                             <filter string="Privacy" icon="terp-locked"
466                                 domain="[]" context="{'group_by':'class'}" />
467                             <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]"
468                                 context="{'group_by':'state'}" />
469                             <separator orientation="vertical" />
470                             <filter string="Date" icon="terp-go-month"
471                                 domain="[]" context="{'group_by':'date'}" />
472                         </group>
473                 </search>
474             </field>
475         </record>
476
477
478         <!-- Event action  -->
479
480         <record id="action_view_event" model="ir.actions.act_window">
481                 <field name="name">Events</field>
482                 <field name="type">ir.actions.act_window</field>
483                 <field name="res_model">calendar.event</field>
484                 <field name="view_type">form</field>
485                 <field name="view_mode">tree,form,calendar</field>
486                 <field name="search_view_id" ref="view_calendar_event_filter"/>
487             </record>
488
489         <!-- Event menu  -->
490
491         <menuitem id="menu_events"
492                 name="Events" parent="base.menu_calendar_configuration"
493                 sequence="15" action="action_view_event" />
494
495      </data>
496  </openerp>