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