[ADD] send mail
[odoo/odoo.git] / addons / event / event_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5         <menuitem name="Association" id="base.menu_association" icon="terp-calendar" sequence="9"/>
6         <menuitem name="Marketing" icon="terp-crm" id="base.marketing_menu" sequence="17"/>
7
8         <menuitem name="Events Organisation" id="base.menu_event_main" parent="base.marketing_menu" />
9         <menuitem name="Events" id="base.menu_event_association" parent="base.menu_association" />
10
11     <!-- EVENTS  -->
12
13     <!-- EVENTS/CONFIGURATION/TYPE OF EVENTS -->
14         <record model="ir.ui.view" id="view_event_type_form">
15             <field name="name">Event type</field>
16             <field name="model">event.type</field>
17             <field name="type">form</field>
18             <field name="arch" type="xml">
19                 <form string="Event Type">
20                     <field name="name" select="1"/>
21                 </form>
22             </field>
23         </record>
24
25         <record model="ir.ui.view" id="view_event_type_tree">
26             <field name="name">Event type</field>
27             <field name="model">event.type</field>
28             <field name="type">tree</field>
29             <field name="arch" type="xml">
30                 <tree string="Event Type">
31                     <field name="name"/>
32                 </tree>
33             </field>
34         </record>
35
36         <record model="ir.actions.act_window" id="action_event_type">
37             <field name="name">Types of Events</field>
38             <field name="res_model">event.type</field>
39             <field name="view_type">form</field>
40         </record>
41         <menuitem name="Configuration" id="base.menu_marketing_config_root" parent="base.marketing_menu" sequence="30" groups="base.group_extended"/>
42         <menuitem name="Configuration" id="base.menu_marketing_config_association" parent="base.menu_association" sequence="30" groups="base.group_extended"/>
43
44         <menuitem name="Types of Events" id="menu_event_type" action="action_event_type" parent="base.menu_marketing_config_root" groups="base.group_extended"/>
45         <menuitem name="Events Type" id="menu_event_type_association" action="action_event_type" parent="base.menu_marketing_config_association" groups="base.group_extended"/>
46
47     <!-- Events Organisation/CONFIGURATION/EVENTS -->
48
49         <record model="ir.ui.view" id="view_event_form">
50             <field name="name">Events</field>
51             <field name="model">event.event</field>
52             <field name="type">form</field>
53             <field name="arch" type="xml">
54                 <form string="Events">
55                     <group col="6" colspan="4">
56                         <field name="name"/>
57                         <field name="date_begin"/>
58                         <field name="date_end"/>
59                         <field name="type" widget="selection"/>
60                         <field name="language"/>
61                         <field name="parent_id"/>
62                     </group>
63                     <notebook colspan="4">
64                     <page string="Event">
65                         <group colspan="4" col="4">
66                             <separator string="Invoice Information" colspan="4"/>
67                             <field name="product_id" on_change="onchange_product(product_id)" colspan="4"/>
68                             <field name="unit_price"/>
69                             <field name="pricelist_id" widget="selection" domain="[('type','=','sale')]" groups="base.group_extended"/>
70                         </group>
71                         <group colspan="2" col="2">
72                             <separator string="Contact" colspan="4"/>
73                             <field name="user_id"/>
74                             <field name="section_id" widget="selection" on_change="do_team_change(section_id)"/>
75                             <field name="company_id" groups="base.group_multi_company" widget="selection"/>
76                         </group>
77                         <group colspan="2" col="2">
78                             <separator string="Location" colspan="4"/>
79                             <field name="country_id" />
80                             <field name="address_id" domain="[('country_id','=',country_id)]"/>
81
82                         </group>
83                         <separator string="Description" colspan="4"/>
84                         <field name="note" colspan="4" nolabel="1"/>
85                         <field name="state" select="1"/>
86                         <group col="4" colspan="2">
87                            <button string="Cancel Event" name="button_cancel" states="draft,confirm" type="object" icon="gtk-cancel"/>
88                            <button string="Confirm Event" name="button_confirm" states="draft" type="object" icon="gtk-apply"/>
89                            <button string="Event Done" name="button_done" states="confirm" type="object" icon="gtk-jump-to"/>
90                            <button string="Set To Draft" name="button_draft" states="cancel" type="object" icon="gtk-convert"/>
91                         </group>
92                     </page>
93                     <page string="Speakers">
94                         <field name="main_speaker_id" domain="[('speaker','=',True)]"/>
95                         <field name="speaker_confirmed"/>
96                         <separator string="Other Speakers" colspan="4"/>
97                         <field name="speaker_ids" domain="[('speaker','=',True)]" colspan="4" nolabel="1"/>
98                     </page>
99                     <page string="Registrations">
100                         <field name="register_min"/>
101                         <field name="register_max"/>
102                         <field name="register_current"/>
103                         <field name="register_prospect"/>
104                         <field name="registration_ids" colspan="4" nolabel="1" readonly="1">
105                             <form string="Registration">
106                                 <field name="name"/>
107                                 <field name="date" string="Date"/>
108                                 <field name="partner_id" required="1" on_change="onchange_partner_id(partner_id,event_id)"/>
109                                 <field name="partner_invoice_id" on_change="onchange_partner_invoice_id(event_id, partner_invoice_id)"/>
110                                 <group colspan="4" col="4">
111                                     <field name="event_product"/>
112                                     <field name="nb_register"/>
113                                     <field name="unit_price"/>
114                                     <field name="price_subtotal"/>
115                                 </group>
116                                 <group col="8" colspan="4">
117                                     <separator string="" colspan="4"/>
118                                     <newline/>
119                                     <field name="state" select="1" colspan="2"/>
120                                     <button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
121                                     <button name="check_confirm" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
122                                     <button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
123                                 </group>
124                             </form>
125                             <tree string="Registration">
126                                     <field name="create_date" string="Registration Date"/>
127                                     <field name="partner_id" required="1" string="Partner" on_change="onchange_partner_id(partner_id,event_id)"/>
128                                     <field name="event_product"/>
129                                     <field name="nb_register"/>
130                                     <field name="unit_price"/>
131                                     <field name="price_subtotal"/>
132                                     <field name="state"/>
133                                     <button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
134                                     <button name="check_confirm" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
135                                     <button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
136                             </tree>
137                         </field>
138                     </page>
139                     <page string="Mailing">
140                         <newline/>
141                         <group col="4" colspan="4">
142                             <group col="2" colspan="2">
143                                 <field name="email_registration_id"/>
144                             </group>
145                             <group col="2" colspan="2">
146                                 <field name="email_confirmation_id"/>
147                             </group>
148                         </group>
149                     </page>
150                     </notebook>
151             </form>
152             </field>
153         </record>
154
155         <!-- Event tree view -->
156
157         <record model="ir.ui.view" id="view_event_tree">
158             <field name="name">event.event.tree</field>
159             <field name="model">event.event</field>
160             <field name="type">tree</field>
161             <field name="arch" type="xml">
162                 <tree string="Events" colors="red:register_min>register_current;black:register_min&lt;=register_current">
163                     <field name="name" string="Name"/>
164                     <field name="main_speaker_id"/>
165                     <field name="language"/>
166                     <field name="type"/>
167                     <field name="date_begin"/>
168                     <field name="date_end"/>
169                     <field name="register_min"/>
170                     <field name="register_current"/>
171                     <field name="section_id" invisible="context.get('invisible_section', True)"/>
172                     <field name="user_id"/>
173                     <field name="state"/>
174                     <button string="Confirm Event" help="Confirm Event" name="button_confirm" states="draft" type="object" icon="gtk-apply"/>
175                     <button string="Cancel Event" help="Cancel Event" name="button_cancel" states="draft,confirm" type="object" icon="gtk-cancel"/>
176                     <button string="Event Done" help="Event Done" name="button_done" states="confirm" type="object" icon="gtk-jump-to"/>
177                     <button string="Set To Draft" help="Set To Draft" name="button_draft" states="confirm,cancel,done" type="object" icon="gtk-convert"/>
178                 </tree>
179             </field>
180         </record>
181
182       <!-- Events  Calendar  View -->
183
184         <record id="view_event_calendar" model="ir.ui.view">
185             <field name="name">event.event.calendar</field>
186             <field name="model">event.event</field>
187             <field name="type">calendar</field>
188             <field eval="2" name="priority"/>
189             <field name="arch" type="xml">
190                 <calendar color="user_id" date_start="date_begin" string="Event Organization">
191                     <field name="name"/>
192                     <field name="type" widget="selection"/>
193                 </calendar>
194             </field>
195         </record>
196
197         <!-- Event Graph view -->
198
199         <record model="ir.ui.view" id="view_event_graph">
200             <field name="name">Event Graph</field>
201             <field name="model">event.event</field>
202             <field name="type">graph</field>
203             <field name="arch" type="xml">
204                 <graph string="Event by Registration" type="bar" orientation="horizontal">
205                     <field name="name"/>
206                     <field name="register_current" operator="+"/>
207                     <field name="register_prospect" operator="+"/>
208                 </graph>
209             </field>
210         </record>
211
212     <!-- Event Search View -->
213
214         <record model="ir.ui.view" id="view_event_search">
215             <field name="name">Events</field>
216             <field name="model">event.event</field>
217             <field name="type">search</field>
218             <field name="arch" type="xml">
219                 <search string="Events">
220                     <group>
221                         <filter icon="terp-check" string="New" name="draft" domain="[('state','=','draft')]" help="Events in New state"/>
222                         <filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','confirm')]" help="Confirmed events"/>
223                         <separator orientation="vertical"/>
224                         <field name="name"/>
225                         <field name="user_id" widget="selection">
226                         <filter icon="terp-personal"
227                               string="My Events"
228                                 help="My Events"
229                               domain="[('user_id','=',uid)]"/>
230                         </field>
231                         <field name="date_begin"/>
232                         <field name="section_id" widget="selection" groups="base.group_extended">
233                           <filter icon="terp-personal+"
234                                   context="{'invisible_section': False}"
235                                   domain="[('section_id.user_id','=',uid)]"
236                                   groups="base.group_extended"
237                                   help="My Sales Team(s)"/>
238                         </field>
239                     </group>
240                     <newline/>
241                     <group expand="0" string="Group By...">
242                         <filter string="Responsible"  icon="terp-personal" context="{'group_by': 'user_id'}"/>
243                         <separator orientation="vertical"/>
244                         <filter string="Event Type" icon="terp-crm"  context="{'group_by':'type'}"/>
245                         <filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
246                         <separator orientation="vertical"/>
247                         <filter string="Beginning Date" icon="terp-go-month"
248                             domain="[]" context="{'group_by':'date_begin'}"/>
249                     </group>
250                 </search>
251             </field>
252         </record>
253
254     <!-- Events Organisation/CONFIGURATION/EVENTS  -->
255
256        <record model="ir.actions.act_window" id="action_event_view">
257            <field name="name">Events</field>
258            <field name="type">ir.actions.act_window</field>
259            <field name="res_model">event.event</field>
260            <field name="view_type">form</field>
261            <field name="view_mode">tree,form,calendar,graph</field>
262            <field name="context">{"search_default_draft": "1", "search_default_section_id": section_id}</field>
263            <field name="search_view_id" ref="view_event_search"/>
264            <field name="help">Event is the low level object used by meeting and others documents that should be synchronized with mobile devices or calendar applications through caldav. Most of the users should work in the Calendar menu, and not in the list of events.</field>
265        </record>
266
267       <act_window
268             id="act_event_list_register_event"
269             name="Registration"
270             res_model="event.registration"
271             src_model="event.event"
272             view_mode="tree,form,calendar,graph"
273             context="{'search_default_event_id': [active_id], 'default_event_id': active_id}"
274             view_type="form"/>
275
276       <act_window
277             id="act_register_event_partner"
278             name="Subscribe"
279             res_model="event.registration"
280             src_model="res.partner"
281             view_mode="tree,form,calendar,graph"
282             context="{'search_default_partner_id': [active_id], 'default_partner_id': active_id}"
283             view_type="form"/>
284
285        <menuitem name="Events" id="menu_event_event" action="action_event_view" parent="base.menu_event_main" />
286        <menuitem name="Events" id="menu_event_event_assiciation" action="action_event_view" parent="base.menu_event_association" />
287
288     <!-- EVENTS/REGISTRATIONS/EVENTS  -->
289
290
291         <record model="ir.ui.view" id="view_event_registration_tree">
292             <field name="name">event.registration.tree</field>
293             <field name="model">event.registration</field>
294             <field name="type">tree</field>
295             <field name="arch" type="xml">
296                 <tree string="Registration">
297                     <field name="partner_id"/>
298                     <field name="event_id"/>
299                     <field name="nb_register"/>
300                     <field name="price_subtotal" sum="Total"/>
301                     <field name="user_id"/>
302                     <field name="state"/>
303                     <button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
304                     <button name="check_confirm" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
305                     <button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
306                 </tree>
307             </field>
308         </record>
309
310         <record model="ir.ui.view" id="view_event_registration_form">
311             <field name="name">event.registration.form</field>
312             <field name="model">event.registration</field>
313             <field name="type">form</field>
314             <field name="arch" type="xml">
315                 <form string="Registration">
316                     <group col="6" colspan="4">
317                         <field name="event_id" on_change="onchange_event(event_id, partner_invoice_id)" domain="[('state','in',('draft','confirm'))]"/>
318                         <field name="create_date" string="Registration Date"/>
319                         <field name="name"/>
320                         <field name="partner_id" attrs="{'readonly':[('state','!=', 'draft')]}" required="1" on_change="onchange_partner_id(partner_id,event_id)" />
321                         <field name="user_id" attrs="{'readonly':[('state','!=', 'draft')]}" />
322                         <field name="tobe_invoiced"/>
323                     </group>
324                     <notebook colspan="4">
325                         <page string="Registration">
326                             <field name="date" />
327                             <field name="date_deadline" />
328                             <group colspan="2" col="2">
329                                 <separator string="Registration Cost" colspan="4"/>
330                                 <field name="nb_register"/>
331                                 <field name="unit_price"/>
332                                 <field name="price_subtotal"/>
333                             </group>
334                             <group colspan="2" col="2" attrs="{'invisible':[('tobe_invoiced','=',False)]}">
335                                 <separator string="Invoice" colspan="4"/>
336                                 <field name="event_product" attrs="{'required':[('tobe_invoiced','=',True)]}"/>
337                                 <field name="partner_invoice_id" attrs="{'required':[('tobe_invoiced','=',True)]}" on_change="onchange_partner_invoice_id(event_id, partner_invoice_id)"/>
338                                 <field name="invoice_id"/>
339                            </group>
340                             <separator string="Description" colspan="4"/>
341                             <field name="description" colspan="4" nolabel="1"/>
342                             <separator string="" colspan="4"/>
343                             <group col="8" colspan="4">
344                                 <field name="state" select="1" colspan="2"/>
345                                 <button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
346                                 <button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
347                                 <button name="check_confirm" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
348                             </group>
349                         </page>
350                         <page string="Extra Info">
351                             <separator string="Contact" colspan="4"/>
352                             <field name="contact_id" on_change="onchange_contact_id(contact_id, partner_id)" />
353                             <field name="email_from"/>
354                             <field name="badge_ids" colspan="4" nolabel="1">
355                                 <tree string="Badges" editable="bottom">
356                                     <field name="name"/>
357                                     <field name="title"/>
358                                     <field name="address_id"/>
359                                 </tree>
360                                 <form string="Badges">
361                                     <field name="name"/>
362                                     <field name="title"/>
363                                     <field name="address_id"/>
364                                 </form>
365                             </field>
366                             <group col="2" colspan="2" groups="base.group_extended">
367                                <separator string="Dates" colspan="2"/>
368                                <field name="date_closed"/>
369                             </group>
370                             <group col="2" colspan="2" groups="base.group_extended">
371                                <separator string="Misc" colspan="2"/>
372                                <field name="id"/>
373                                <field name="active"/>
374                             </group>
375                         </page>
376                         <page string="Emails" groups="base.group_extended">
377                             <group colspan="4">
378                                  <field colspan="4" name="email_cc" string="CC" widget="char" size="512"/>
379                             </group>
380                             <field name="message_ids" colspan="4" nolabel="1" mode="tree">
381                                 <tree string="History">
382                                     <field name="display_text" string="History Information"/>
383                                     <field name="email_from" invisible="1"/>
384                                     <button
385                                         string="Reply" attrs="{'invisible': [('email_from', '=', False)]}"
386                                         name="%(mail.action_email_compose_message_wizard)d"
387                                         context="{'mail.compose.message.mode':'reply', 'message_id':active_id}"
388                                         icon="terp-mail-replied" type="action" />
389                                 </tree>
390                             </field>
391                             <button string="Add Internal Note"
392                                 name="%(crm.action_crm_add_note)d"
393                                 context="{'model': 'crm.lead' }"
394                                 icon="terp-document-new" type="action" />
395                             <button string="Send New Email"
396                                 name="%(mail.action_email_compose_message_wizard)d"
397                                 icon="terp-mail-message-new" type="action"/>
398                            </page>
399                     </notebook>
400                 </form>
401             </field>
402         </record>
403
404  <!-- Calendar view of event registration -->
405
406         <record id="view_event_registration_calendar" model="ir.ui.view">
407             <field name="name">event.registration.calendar</field>
408             <field name="model">event.registration</field>
409             <field name="type">calendar</field>
410             <field eval="2" name="priority"/>
411             <field name="arch" type="xml">
412                 <calendar color="event_id" date_start="date" date_stop="date_closed" string="Event Registration">
413                     <field name="event_id"/>
414                     <field name="partner_invoice_id"/>
415                 </calendar>
416             </field>
417         </record>
418
419         <record model="ir.ui.view" id="view_event_registration_graph">
420             <field name="name">Registration Graph</field>
421             <field name="model">event.registration</field>
422             <field name="type">graph</field>
423             <field name="arch" type="xml">
424                 <graph string="Registration" type="bar" orientation="horizontal">
425                     <field name="event_id"/>
426                     <field name = "nb_register" operator="+"/>
427                 </graph>
428             </field>
429         </record>
430
431
432 <!-- Search view of event registration form-->
433
434         <record model="ir.ui.view" id="view_registration_search">
435             <field name="name">Registrations</field>
436             <field name="model">event.registration</field>
437             <field name="type">search</field>
438             <field name="arch" type="xml">
439                 <search string="Event Registration">
440                     <group>
441                         <filter icon="terp-check" string="New" name="draft" domain="[('state','=','draft')]" help="Registrations in unconfirmed state"/>
442                         <filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','open')]" help="Confirmed registrations"/>
443                         <separator orientation="vertical"/>
444                         <field name="partner_id" />
445                         <field name="event_id" widget="selection"/>
446                         <field name="user_id" widget="selection">
447                         <filter icon="terp-personal"
448                               string="My Registrations"
449                                 help="My Registrations"
450                               domain="[('user_id','=',uid)]"/>
451                         </field>
452                         <field name="state"/>
453                     </group>
454                     <newline/>
455                     <group expand="0" string="Group By...">
456                         <filter string="Responsible"  icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
457                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
458                         <separator orientation="vertical"/>
459                         <filter string="Event" icon="terp-crm" domain="[]" context="{'group_by':'event_id'}"/>
460                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'registration_state'}"/>
461                    </group>
462
463                 </search>
464             </field>
465         </record>
466
467         <record model="ir.actions.act_window" id="action_registration">
468           <field name="name">Registrations</field>
469           <field name="res_model">event.registration</field>
470           <field name="view_type">form</field>
471           <field name="domain"></field>
472           <field name="view_mode">tree,form,calendar,graph</field>
473           <field name="context">{"search_default_draft": "1"}</field>
474           <field name="search_view_id" ref="view_registration_search"/>
475         </record>
476
477         <menuitem
478             name="Registrations"
479             id="menu_action_registration" parent="base.menu_event_main"
480             action="action_registration"/>
481
482         <menuitem
483             name="Registrations"
484             id="menu_action_registration_association" parent="base.menu_event_association"
485             action="action_registration"/>
486
487         <menuitem name="Reporting" id="base.menu_report_association" parent="base.marketing_menu" sequence="20"/>
488     </data>
489 </openerp>