[ADD] trigger mail with email.template
[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" invisible="1"/>
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" invisible="1"/>
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" invisible="1"/>
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="date" />
319                         <field name="date_deadline" />
320                         <field name="name"/>
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                             <group colspan="2" col="2">
327                             <separator string="partner" colspan="4"/>
328                             <field name="partner_id" attrs="{'readonly':[('state','!=', 'draft')]}" required="1" on_change="onchange_partner_id(partner_id,event_id)" />
329                             <field name="partner_id_address" colspan="4" />
330
331                             </group>
332                             <group colspan="2" col="2">
333                                 <separator string="Registration Cost" colspan="4"/>
334                                 <field name="nb_register" invisible="1"/>
335                                 <field name="unit_price"/>
336                                 <field name="price_subtotal" invisible="1"/>
337                             </group>
338
339                             <separator string="" colspan="4"/>
340                             <group col="8" colspan="4">
341                                 <field name="state" select="1" colspan="2"/>
342                                 <button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
343                                 <button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
344                                 <button name="check_confirm" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
345                             </group>
346                         </page>
347                         <page string='invoice'>
348                                 <field name="event_product" attrs="{'required':[('tobe_invoiced','=',True)]}"/>
349                                 <field name="partner_invoice_id" attrs="{'required':[('tobe_invoiced','=',True)]}" on_change="onchange_partner_invoice_id(event_id, partner_invoice_id)"/>
350                                 <field name="invoice_id"/>
351                         </page>
352                         <page string="Extra Info">
353                             
354                             <field name="create_date" string="Registration Date"/>
355                             <separator string="Contact" colspan="4"/>
356                             
357                             <field name="contact_id" on_change="onchange_contact_id(contact_id, partner_id)" />
358                             <field name="email_from"/>
359                             <field name="badge_ids" colspan="4" nolabel="1">
360                                 <tree string="Badges" editable="bottom">
361                                     <field name="name"/>
362                                     <field name="title"/>
363                                     <field name="address_id"/>
364                                 </tree>
365                                 <form string="Badges">
366                                     <field name="name"/>
367                                     <field name="title"/>
368                                     <field name="address_id"/>
369                                 </form>
370                             </field>
371                             <group col="2" colspan="2" groups="base.group_extended">
372                                <separator string="Dates" colspan="2"/>
373                                <field name="date_closed"/>
374                             </group>
375                             <group col="2" colspan="2" groups="base.group_extended">
376                                <separator string="Misc" colspan="2"/>
377                                <field name="id"/>
378                                <field name="active"/>
379                             </group>
380                         </page>
381                         <page string="Emails" groups="base.group_extended">
382                             <group colspan="4">
383                                  <field colspan="4" name="email_cc" string="CC" widget="char" size="512"/>
384                             </group>
385                             <field name="message_ids" colspan="4" nolabel="1" mode="tree">
386                                 <tree string="History">
387                                     <field name="display_text" string="History Information"/>
388                                     <field name="email_from" invisible="1"/>
389                                     <button
390                                         string="Reply" attrs="{'invisible': [('email_from', '=', False)]}"
391                                         name="%(mail.action_email_compose_message_wizard)d"
392                                         context="{'mail.compose.message.mode':'reply', 'message_id':active_id}"
393                                         icon="terp-mail-replied" type="action" />
394                                 </tree>
395                             </field>
396                             <button string="Add Internal Note"
397                                 name="%(crm.action_crm_add_note)d"
398                                 context="{'model': 'crm.lead' }"
399                                 icon="terp-document-new" type="action" />
400                             <button string="Send New Email"
401                                 name="%(mail.action_email_compose_message_wizard)d"
402                                 icon="terp-mail-message-new" type="action"/>
403                            </page>
404                            <page string="Note">
405                                 <field name="description" colspan="4" nolabel="1"/>
406                            </page>
407                     </notebook>
408                 </form>
409             </field>
410         </record>
411
412  <!-- Calendar view of event registration -->
413
414         <record id="view_event_registration_calendar" model="ir.ui.view">
415             <field name="name">event.registration.calendar</field>
416             <field name="model">event.registration</field>
417             <field name="type">calendar</field>
418             <field eval="2" name="priority"/>
419             <field name="arch" type="xml">
420                 <calendar color="event_id" date_start="date" date_stop="date_closed" string="Event Registration">
421                     <field name="event_id"/>
422                     <field name="partner_invoice_id"/>
423                 </calendar>
424             </field>
425         </record>
426
427         <record model="ir.ui.view" id="view_event_registration_graph">
428             <field name="name">Registration Graph</field>
429             <field name="model">event.registration</field>
430             <field name="type">graph</field>
431             <field name="arch" type="xml">
432                 <graph string="Registration" type="bar" orientation="horizontal">
433                     <field name="event_id"/>
434                     <field name = "nb_register" operator="+"/>
435                 </graph>
436             </field>
437         </record>
438
439
440 <!-- Search view of event registration form-->
441
442         <record model="ir.ui.view" id="view_registration_search">
443             <field name="name">Registrations</field>
444             <field name="model">event.registration</field>
445             <field name="type">search</field>
446             <field name="arch" type="xml">
447                 <search string="Event Registration">
448                     <group>
449                         <filter icon="terp-check" string="New" name="draft" domain="[('state','=','draft')]" help="Registrations in unconfirmed state"/>
450                         <filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','open')]" help="Confirmed registrations"/>
451                         <separator orientation="vertical"/>
452                         <field name="partner_id" />
453                         <field name="event_id" widget="seemaillection"/>
454                         <field name="user_id" widget="selection">
455                         <filter icon="terp-personal"
456                               string="My Registrations"
457                                 help="My Registrations"
458                               domain="[('user_id','=',uid)]"/>
459                         </field>
460                         <field name="state"/>
461                     </group>
462                     <newline/>
463                     <group expand="0" string="Group By...">
464                         <filter string="Responsible"  icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
465                         <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
466                         <separator orientation="vertical"/>
467                         <filter string="Event" icon="terp-crm" domain="[]" context="{'group_by':'event_id'}"/>
468                         <filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'registration_state'}"/>
469                    </group>
470
471                 </search>
472             </field>
473         </record>
474
475         <record model="ir.actions.act_window" id="action_registration">
476           <field name="name">Registrations</field>
477           <field name="res_model">event.registration</field>
478           <field name="view_type">form</field>
479           <field name="domain"></field>
480           <field name="view_mode">tree,form,calendar,graph</field>
481           <field name="context">{"search_default_draft": "1"}</field>
482           <field name="search_view_id" ref="view_registration_search"/>
483         </record>
484
485         <menuitem
486             name="Registrations"
487             id="menu_action_registration" parent="base.menu_event_main"
488             action="action_registration"/>
489
490         <menuitem
491             name="Registrations"
492             id="menu_action_registration_association" parent="base.menu_event_association"
493             action="action_registration"/>
494
495         <menuitem name="Reporting" id="base.menu_report_association" parent="base.marketing_menu" sequence="20"/>
496     </data>
497 </openerp>