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