[IMP] event: usability improvements
[odoo/odoo.git] / addons / event / event_view.xml
index 750b9bc..b081a96 100644 (file)
@@ -2,11 +2,8 @@
 <openerp>
     <data>
 
-        <menuitem name="Association" id="base.menu_association" icon="terp-calendar" sequence="9"/>
-        <menuitem name="Marketing" icon="terp-crm" id="base.marketing_menu" sequence="17"/>
-
-        <menuitem name="Events Organisation" id="base.menu_event_main" parent="base.marketing_menu" />
-        <menuitem name="Events" id="base.menu_event_association" parent="base.menu_association" />
+       <menuitem  name="Events" id="event_main_menu"/>
+        <menuitem name="Events Organisation" id="base.menu_event_main" parent="event_main_menu" />
 
     <!-- EVENTS  -->
 
             <field name="arch" type="xml">
                 <form string="Event Type">
                     <field name="name" select="1"/>
+                    <field name="default_reply_to"/>
+                    <field name="default_email_event"/>
+                    <field name="default_email_registration"/>
+                    <field name="default_registration_min"/>
+                    <field name="default_registration_max"/>
                 </form>
             </field>
         </record>
             <field name="res_model">event.type</field>
             <field name="view_type">form</field>
         </record>
-        <menuitem name="Configuration" id="base.menu_marketing_config_root" parent="base.marketing_menu" sequence="30"/>
-        <menuitem name="Configuration" id="base.menu_marketing_config_association" parent="base.menu_association" sequence="30"/>
-
+        <menuitem name="Configuration" id="base.menu_marketing_config_root" parent="event_main_menu" sequence="30"/>
         <menuitem name="Types of Events" id="menu_event_type" action="action_event_type" parent="base.menu_marketing_config_root"/>
-        <menuitem name="Events Type" id="menu_event_type_association" action="action_event_type" parent="base.menu_marketing_config_association"/>
 
     <!-- Events Organisation/CONFIGURATION/EVENTS -->
 
@@ -56,7 +55,7 @@
                         <field name="name"/>
                         <field name="date_begin"/>
                         <field name="date_end"/>
-                        <field name="type" widget="selection"/>
+                        <field name="type" on_change="onchange_evnet_type(type,context)"/>
                         <field name="user_id"/>
                         <field name="address_id" />
                     </group>
                                 <field name="phone"/>
                                 <field name="nb_register" />
                                 <field name="state"/>
-                                <button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
-                                <button name="case_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
+                                <button name="registration_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
+                                <button name="button_reg_close" string="Attented the Event" states="open" type="object" icon="gtk-jump-to"/>
                                 <button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
                             </tree>
                             <form string="Registration">
                                 <field name="partner_id" attrs="{'readonly':[('state','!=', 'draft')]}" on_change="onchange_partner_id(partner_id, context)" />
                                 <field name="name"/>
                                 <group colspan="4" col="4">
-                                <field name="street"/>
-                                <field name="city"/>
-                                </group>
-                                <group colspan="4" col="4">
                                 <field name="email"/>
                                 <field name="phone"/>
                                 </group>
                                         <separator string="" colspan="4"/>
                                         <newline/>
                                         <field name="state" select="1" colspan="2"/>
-                                        <button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
-                                        <button name="case_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
+                                        <button name="registration_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
+                                        <button name="button_reg_close" string="Attended the Event" states="open" type="object" icon="gtk-jump-to"/>
                                         <button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
                                     </group>
                             </form>
-                            </field> 
+                            </field>
                         <field name="state" select="1" widget="statusbar" statusbar_visible="draft,confirm,done"/>
                         <group col="4" colspan="2">
                            <button string="Cancel Event" name="button_cancel" states="draft,confirm" type="object" icon="gtk-cancel"/>
                            <button string="Confirm Event" name="button_confirm" states="draft" type="object" icon="gtk-apply"/>
                            <button string="Event Done" name="button_done" states="confirm" type="object" icon="gtk-jump-to"/>
-                           <button string="Set To Draft" name="button_draft" states="cancel" type="object" icon="gtk-convert"/>
+                           <button string="Set To Draft" name="button_draft" states="cancel,done" type="object" icon="gtk-convert"/>
                         </group>
                     </page>
                     <page string="Speakers" groups="base.group_extended">
                             <separator string="Registrations" colspan="2"/>
                             <field name="register_min"/>
                             <field name="register_max"/>
-                            <field name="register_current"/>
                             <field name="register_prospect"/>
+                            <field name="register_current"/>
+                            <field name="register_attended"/>
                         </group>
                         <group col="2" colspan="2">
                             <separator string="Emails" colspan="2"/>
                             <field name="reply_to"/>
-                            <field name="email_registration_id" domain="[('model_id','=','Event Registration')]"/>
-                            <field name="email_confirmation_id"/>
-                        </group>
-                        <group col="2" colspan="2" groups="base.group_extended">
-                            <separator string="Misc" colspan="2"/>
-                        </group>
-                        <group col="2" colspan="2">
-                            <separator string="Sales Team" colspan="2"/>
-                            <field name="section_id" on_change="do_team_change(self, cr, uid, ids, team_id)"/>
+                            <field name="email_registration_id" domain="[('model_id','=',ref('event.event_registration'))]" groups="base.group_extended"/>
+                            <field name="email_confirmation_id" domain="[('model_id','=',ref('event.event_event'))]" groups="base.group_extended"/>
                         </group>
                     </page>
                     </notebook>
             <field name="model">event.event</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree string="Events" colors="red:register_min>register_current;black:register_min&lt;=register_current">
+                <tree string="Events" colors="red:(register_min and register_min&gt;register_current) or (register_max and register_max&lt;register_current);grey:state=='cancel'">
                     <field name="name" string="Name"/>
                     <field name="type"/>
                     <field name="date_begin"/>
                     <field name="date_end"/>
                     <field name="register_current"/>
                     <field name="register_min"/>
-                    <field name="section_id" invisible="context.get('invisible_section', True)"/>
+                    <field name="register_max" invisible="1"/>
                     <field name="main_speaker_id" groups="base.extended"/>
                     <field name="user_id"/>
                     <field name="state"/>
                     <button string="Confirm Event" help="Confirm Event" name="button_confirm" states="draft" type="object" icon="gtk-apply"/>
-                    <button string="Cancel Event" help="Cancel Event" name="button_cancel" states="draft,confirm" type="object" icon="gtk-cancel"/>
                     <button string="Event Done" help="Event Done" name="button_done" states="confirm" type="object" icon="gtk-jump-to"/>
-                    <button string="Set To Draft" help="Set To Draft" name="button_draft" states="confirm,cancel,done" type="object" icon="gtk-convert"/>
+                    <button string="Cancel Event" help="Cancel Event" name="button_cancel" states="draft,confirm" type="object" icon="gtk-cancel"/>
+                    <button string="Set To Draft" help="Set To Draft" name="button_draft" states="cancel,done" type="object" icon="gtk-convert"/>
                 </tree>
             </field>
         </record>
             <field name="type">calendar</field>
             <field eval="2" name="priority"/>
             <field name="arch" type="xml">
-                <calendar color="user_id" date_start="date_begin" date_stop="date_end" string="Event Organization">
+                <calendar color="type" date_start="date_begin" date_stop="date_end" string="Event Organization">
                     <field name="name"/>
-                    <field name="type" widget="selection"/>
+                    <field name="type"/>
                 </calendar>
             </field>
         </record>
             <field name="arch" type="xml">
                 <search string="Events">
                     <group>
-                        <filter icon="terp-check" string="New" name="draft" domain="[('state','=','draft')]" help="Events in New state"/>
+                        <filter icon="terp-check" string="Unconfirmed" name="draft" domain="[('state','=','draft')]" help="Events in New state"/>
                         <filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','confirm')]" help="Confirmed events"/>
                         <separator orientation="vertical"/>
                         <field name="name"/>
                                 help="My Events"
                               domain="[('user_id','=',uid)]"/>
                         </field>
-                        <field name="date_begin"/>
-                        <field name="section_id" widget="selection" groups="base.group_extended">
-                          <filter icon="terp-personal+"
-                                  context="{'invisible_section': False}"
-                                  domain="[('section_id.user_id','=',uid)]"
-                                  groups="base.group_extended"
-                                  help="My Sales Team(s)"/>
-                        </field>
                     </group>
                     <newline/>
                     <group expand="0" string="Group By...">
                         <filter string="Event Type" icon="terp-crm"  context="{'group_by':'type'}"/>
                         <filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
                         <separator orientation="vertical"/>
-                        <filter string="Beginning Date" icon="terp-go-month"
+                        <filter string="Starting Date" icon="terp-go-month"
                             domain="[]" context="{'group_by':'date_begin'}"/>
                     </group>
                 </search>
            <field name="res_model">event.event</field>
            <field name="view_type">form</field>
            <field name="view_mode">calendar,tree,form,graph</field>
-           <field name="context">{"search_default_draft": "1", "search_default_section_id": section_id}</field>
            <field name="search_view_id" ref="view_event_search"/>
            <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>
        </record>
             name="Registration"
             res_model="event.registration"
             src_model="event.event"
-            view_mode="tree,form,calendar,graph"
+            view_mode="calendar,tree,form,graph"
             context="{'search_default_event_id': [active_id], 'default_event_id': active_id}"
             view_type="form"/>
 
             view_type="form"/>
 
        <menuitem name="Events" id="menu_event_event" action="action_event_view" parent="base.menu_event_main" />
-       <menuitem name="Events" id="menu_event_event_assiciation" action="action_event_view" parent="base.menu_event_association" />
-
 
         <!-- EVENTS/REGISTRATIONS/EVENTS  -->
         <record model="ir.ui.view" id="view_event_registration_tree">
             <field name="type">tree</field>
             <field name="arch" type="xml">
                 <tree string="Registration" >
+                    <field name="create_date"/>
                     <field name="name"/>
                     <field name="email"/>
-                    <field name="phone"/>
-                    <field name="event_id"/>
-                    <field name="nb_register" invisible="1"/>
-                    <field name="user_id"/>
+                    <field name="event_id" />
+                    <field name="nb_register"/>
+                    <field name="user_id" groups="base.group_extended"/>
+                    <field name="origin" groups="base.group_extended"/>
                     <field name="state"/>
-                    <button name="case_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
-                    <button name="case_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
                     <button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
-                    <button name="do_draft" string="Set To Draft" states="cancel,done" type="object" icon="gtk-convert"/>
+                    <button name="registration_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
+                    <button name="_close" string="Attended" states="open" type="object" icon="gtk-apply"/>
+                    <button string="Set To Unconfirmed" name="do_draft" states="cancel,done" type="object" icon="gtk-convert"/>
                 </tree>
             </field>
         </record>
                 <form string="Registration">
                     <group col="6" colspan="4">
                         <field name="event_id" on_change="onchange_event(event_id, context)" domain="[('state','in',('draft','confirm'))]"/>
+                        <field name="partner_id" attrs="{'readonly':[('state','!=', 'draft')]}" on_change="onchange_partner_id(partner_id, context)"/>
+                        <field name="contact_id" attrs="{'readonly':[('state','!=', 'draft')]}" domain="[('partner_id','=',partner_id)]" on_change="onchange_contact_id(contact_id, context)"/>
                         <field name="nb_register"/>
-                        <field name="origin"/>
-                        <field name="name" colspan="4"/>
                         <field name="user_id" attrs="{'readonly':[('state','!=', 'draft')]}"/>
+                        <field name="origin"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Additional Information">
                             <group colspan="2" col="2">
                                 <separator string="Contact Information" colspan="2"/>
-                                <field name="partner_id" attrs="{'readonly':[('state','!=', 'draft')]}" on_change="onchange_partner_id(partner_id, context)" groups="base.group_extended"/>
-                                <field name="contact_id" attrs="{'readonly':[('state','!=', 'draft')]}" on_change="onchange_contact_id(contact_id, context)" groups="base.group_extended"/>
+                                <field name="name"/>
                                 <field name="email"/>
                                 <field name="phone"/>
-                                <field name="street"/>
-                                <field name="city"/>
                             </group>
                             <group colspan="2" col="2" groups="base.group_extended">
                                 <separator string="Dates" colspan="2"/>
+                                <field name="create_date"/>
                                 <field name="date_closed"/>
-                                <field name="date" />
-                                <field name="date_deadline" />
+                                <field name="event_begin_date" />
+                                <field name="event_end_date" />
                             </group>
 
                             <separator string="" colspan="4"/>
                             <group col="8" colspan="4">
                                 <field name="state" select="1" colspan="2" widget="statusbar" statusbar_visible="draft,open,done"/>
                                 <button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
-                                <button name="button_reg_close" string="Close Registration" states="open" type="object" icon="gtk-close"/>
-                                <button name="case_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
-                                <button string="Set To Draft" name="do_draft" states="cancel" type="object" icon="gtk-convert"/>
+                                <button name="button_reg_close" string="Attended" states="open" type="object" icon="gtk-apply"/>
+                                <button name="registration_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
+                                <button string="Set To Unconfirmed" name="do_draft" states="cancel,done" type="object" icon="gtk-convert"/>
                             </group>
                         </page>
                         <page string="Emails" groups="base.group_extended">
                             <field name="message_ids" colspan="4" nolabel="1" mode="tree">
                                 <tree string="History">
                                     <field name="display_text" string="History Information"/>
-                                    <field name="email_from" invisible="1"/>
+                                    <field name="reply_to" invisible="1"/>
                                     <button
-                                        string="Reply" attrs="{'invisible': [('email_from', '=', False)]}"
+                                        string="Reply" attrs="{'invisible': [('reply_to', '=', False)]}"
                                         name="%(mail.action_email_compose_message_wizard)d"
                                         context="{'mail.compose.message.mode':'reply', 'message_id':active_id}"
                                         icon="terp-mail-replied" type="action" />
                                 </tree>
                             </field>
-                            <button string="Add Internal Note"
-                                name="%(crm.action_crm_add_note)d"
-                                context="{'model': 'crm.lead' }"
-                                icon="terp-document-new" type="action" />
                             <button string="Send New Email"
                                 name="%(mail.action_email_compose_message_wizard)d"
                                 icon="terp-mail-message-new" type="action"/>
                         <filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','open')]" help="Confirmed registrations"/>
                         <separator orientation="vertical"/>
                         <field name="event_id" widget="selection"/>
-                        <field name="partner_id" groups="base.group_extended"/>
-                        <field name="user_id" widget="selection">
+                        <field name="name" string="Participant"
+                            filter_domain="['|','|','|', ('name','ilike',self), ('contact_id','ilike',self), ('partner_id','ilike',self), ('email','ilike',self)]"/>
+                        <field name="user_id" groups="base.group_extended">
                         <filter icon="terp-personal"
                               string="My Registrations"
                                 help="My Registrations"
                               domain="[('user_id','=',uid)]"/>
                         </field>
-                        <field name="origin"/>
+                        <field name="origin" groups="base.group_extended"/>
                     </group>
                     <newline/>
                     <group expand="0" string="Group By...">
           <field name="view_type">form</field>
           <field name="domain"></field>
           <field name="view_mode">tree,form,calendar,graph</field>
-          <field name="context">{"search_default_draft": "1"}</field>
+          <field name="context">{}</field>
           <field name="search_view_id" ref="view_registration_search"/>
         </record>
 
             id="menu_action_registration" parent="base.menu_event_main"
             action="action_registration"/>
 
-        <menuitem
-            name="Registrations"
-            id="menu_action_registration_association" parent="base.menu_event_association"
-            action="action_registration"/>
 
-        <menuitem name="Reporting" id="base.menu_report_association" parent="base.marketing_menu" sequence="20"/>
+        <menuitem name="Reporting" id="base.menu_report_association" parent="event_main_menu" sequence="20"/>
     </data>
 </openerp>