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