[IMP] CSS of etherpad
[odoo/odoo.git] / addons / crm / crm_phonecall_view.xml
index 2347a83..e070f8f 100644 (file)
@@ -2,8 +2,8 @@
 <openerp>
     <data>
 
-<!--  Phonecall Categories Form View  -->
 
+    <!-- Phonecall Categories Form View  -->
     <record id="crm_phonecall_categ_action" model="ir.actions.act_window">
         <field name="name">Phonecall Categories</field>
         <field name="res_model">crm.case.categ</field>
         <field name="view_id" ref="crm.crm_case_categ_tree-view"/>
         <field name="domain">[('object_id.model', '=', 'crm.phonecall')]</field>
         <field name="context" eval="{'object_id': ref('model_crm_phonecall')}"/>
-        <field name="help">Create specific phone call categories to better define the type of calls tracked in the system.</field>
+        <field name="help" type="html">
+          <p class="oe_view_nocontent_create">
+            Click to add a new category.
+          </p><p>
+            Create specific phone call categories to better define the type of
+            calls tracked in the system.
+          </p>
+        </field>
     </record>
 
     <menuitem action="crm_phonecall_categ_action" name="Categories"
         id="menu_crm_case_phonecall-act" parent="menu_crm_config_phonecall" groups="base.group_no_one"/>
 
-<!--  PhoneCalls Tree View -->
-
+    <!-- Phonecalls Tree View -->
     <record model="ir.ui.view" id="crm_case_phone_tree_view">
         <field name="name">CRM - Phone Calls Tree</field>
         <field name="model">crm.phonecall</field>
-        <field name="type">tree</field>
         <field name="arch" type="xml">
-            <tree fonts="bold:needaction_pending==True" colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
-                <field name="needaction_pending" invisible="1"/>
+            <tree colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
                 <field name="date"/>
                 <field name="name"/>
                 <field name="partner_id"/>
+                <button string="Meeting"
+                    states="open,pending"
+                    name="action_make_meeting"
+                    type="object"/>
+                <button string="Convert to Opportunity"
+                    type="object"
+                    name="action_button_convert2opportunity"
+                    states="open,pending"
+                    attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
                 <field name="partner_phone"/>
                 <field name="user_id"/>
                 <field name="categ_id" invisible="1"/>
                 <field name="create_date" invisible="1"/>
                 <field name="opportunity_id" invisible="1"/>
-                <button string="Convert to Opportunity"
-                    name="%(phonecall2opportunity_act)d"
-                    states="open,pending"
-                    icon="gtk-index"
-                    type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
-                <button string="Meeting"
-                    states="open,pending" icon="gtk-redo"
-                     name="action_make_meeting" type="object" />
                 <field name="state"/>
                 <button name="case_open" string="Confirm" type="object"
                         states="draft,pending" icon="gtk-go-forward"/>
         </field>
     </record>
 
-<!-- Phonecalls Form View -->
-
+    <!-- Phonecalls Form View -->
     <record model="ir.ui.view" id="crm_case_phone_form_view">
         <field name="name">CRM - Phone Call Form</field>
         <field name="model">crm.phonecall</field>
-        <field name="type">form</field>
         <field name="arch" type="xml">
-            <form version="7.0">
-            <header>
-                <button name="case_open" string="Confirm" type="object"
-                        states="draft,pending" icon="gtk-go-forward"/>
-                <button name="case_close" string="Held" type="object"
-                        states="open,pending" icon="gtk-jump-to"/>
-                <button name="case_reset" string="Reset to Todo" type="object"
-                        states="cancel" icon="gtk-convert"/>
-                <button name="case_cancel" string="Cancel" type="object"
-                        states="draft,open,pending" icon="gtk-cancel"/>
-                <button string="Convert to Opportunity"
-                    name="%(phonecall2opportunity_act)d"
-                    icon="gtk-index" type="action"
-                    attrs="{'invisible':[('opportunity_id','!=',False)]}" />
-                <button string="Schedule Other Call"
-                    icon="terp-call-start"
-                    name="%(phonecall_to_phonecall_act)d"
-                    type="action"  />
-                <button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
-                <field name="state" widget="statusbar" nolabel="1" statusbar_visible="draft,open,done"/>
-            </header>
-            <sheet string="Phone Call">
-                 <group col="4">
-                    <field name="name" required="1"/>
-                    <field name="partner_phone"/>
-                    <field name="duration" widget="float_time"/>
-
-                    <field name="date"/>
-                    <field name="user_id"/>
-                    <field name="section_id" colspan="1" widget="selection" />
-                </group>
-
-                <group>
-                    <group string="Contacts">
-                        <field name="partner_id"
-                            on_change="onchange_partner_id(partner_id)" />
-                        <field name="partner_mobile"/>
-                    </group>
-                    <group string="Categorization">
+            <form string="Phone Call" version="7.0">
+                <header>
+                    <button name="case_close" string="Call Done" type="object" class="oe_highlight"
+                            states="open,pending"/>
+                    <button name="case_reset" string="Reset to Todo" type="object"
+                            states="cancel"/>
+                    <button name="case_cancel" string="Cancel" type="object"
+                            states="draft,open,pending"/>
+                    <field name="state" widget="statusbar" nolabel="1" statusbar_visible="open,done"/>
+                </header>
+                <sheet string="Phone Call">
+                    <div class="oe_right">
+                        <button string="Convert to Opportunity"
+                            type="object"
+                            name="action_button_convert2opportunity"
+                            attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state', 'not in', ('open', 'done'))]}"/>
+                        <button string="Schedule Other Call"
+                                name="%(phonecall_to_phonecall_act)d"
+                                type="action"/>
+                        <button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
+                    </div>
+                    <div class="oe_title">
+                        <div class="oe_edit_only">
+                            <label for="name"/>
+                        </div>
+                        <h1><field name="name" required="1"/></h1>
+                        <div class="oe_edit_only">
+                            <label for="partner_phone" string="Phone"/>
+                        </div>
+                        <h2><field name="partner_phone"/></h2>
+                    </div>
+
+                    <group col="4">
+                        <field name="date"/>
+                        <field name="user_id"/>
+                        <field name="duration" widget="float_time"/>
+                        <field name="section_id" colspan="1" widget="selection"/>
+                        <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
+                        <field name="email_from" invisible="1"/> <!--not needed because of the chatter, thus invisible, but must be in the view as it's returned by onchange_partner_id()-->
                         <field name="categ_id" widget="selection"
                             domain="[('object_id.model', '=', 'crm.phonecall')]"/>
+                        <field name="partner_mobile"/>
                         <field name="priority"/>
-                        <field name="opportunity_id"/>
+                        <field name="opportunity_id" on_change="on_change_opportunity(opportunity_id)"/>
                     </group>
-                </group>
-                <separator string="Description"/>
-                <field name="description"/>
-            </sheet>
-            <footer>
-                <field name="message_ids" widget="ThreadView"/>
-            </footer>
+                    <field name="description" placeholder="Description..."/>
+                </sheet>
+                <div class="oe_chatter">
+                    <field name="message_follower_ids" widget="mail_followers"/>
+                    <field name="message_ids" widget="mail_thread"/>
+                </div>
             </form>
         </field>
     </record>
 
     <!--Logged Phonecalls Tree View -->
-
     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
         <field name="name">CRM - Logged Phone Calls Tree</field>
         <field name="model">crm.phonecall</field>
-        <field name="type">tree</field>
         <field name="arch" type="xml">
-            <tree string="Phone Calls" fonts="bold:needaction_pending==True" editable="top">
-                <field name="needaction_pending" invisible="1"/>
+            <tree string="Phone Calls" editable="top">
                 <field name="date"/>
                 <field name="name"/>
                 <field name="partner_id"
-                    on_change="onchange_partner_id(partner_id)"
-                    string="Partner" />
+                    on_change="onchange_partner_id(partner_id)"/>
                 <field name="partner_phone"
                     invisible="1"/>
                 <field name="user_id"/>
                     invisible="1"/>
                 <field name="state" invisible="1"/>
                 <field name="create_date" invisible="1"/>
-                <field name="opportunity_id" invisible="1"/>
+                <field name="opportunity_id" invisible="1" on_change="on_change_opportunity(opportunity_id)"/>
                 <button string="Schedule Other Call"
                     icon="terp-call-start"
                     name="%(phonecall_to_phonecall_act)d"
-                    type="action"  />
+                    type="action"/>
                 <button string="Meeting"
                      icon="gtk-redo"
-                     name="action_make_meeting" type="object" />
+                     name="action_make_meeting" type="object"/>
                 <button string="Convert to Opportunity"
-                    name="%(phonecall2opportunity_act)d"
+                    name="action_button_convert2opportunity"
                     states="open,pending"
                     icon="gtk-index"
-                    type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
+                    type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
             </tree>
         </field>
     </record>
 
-<!-- Phonecalls Calendar View -->
-
+    <!-- Phonecalls Calendar View -->
     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
         <field name="name">CRM - Phone Calls Calendar</field>
         <field name="model">crm.phonecall</field>
-        <field name="type">calendar</field>
         <field name="priority" eval="2"/>
         <field name="arch" type="xml">
             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
         </field>
     </record>
 
-<!-- Phonecalls Search View  -->
-
+    <!-- Phonecalls Search View  -->
     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
         <field name="name">CRM - Phone Calls Search</field>
         <field name="model">crm.phonecall</field>
-        <field name="type">search</field>
         <field name="arch" type="xml">
             <search string="Search Phonecalls">
-               <field name="name"/>
-               <field name="partner_id"/>
-               <field name="user_id">
-                   <filter string="Unassigned Phonecalls"
-                       icon="terp-personal-"
-                       domain="[('user_id','=',False)]"
-                       help="Unassigned Phonecalls" />
-               </field>
-               <field name="section_id"
-                   widget="selection" string="Sales Team">
-                   <filter string="My Sales Team(s)"
-                        icon="terp-personal+"
-                        domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
-                       help="My Sales Team(s)" />
+               <field name="name" string="Phonecalls"/>
                <field name="date"/>
-               </field>
-               <newline/>
-               <group expand="0" string="Group By...">
-                   <filter string="Partner" icon="terp-partner" domain="[]"
-                       context="{'group_by':'partner_id'}" />
-                   <filter string="Responsible" icon="terp-personal"
-                       domain="[]" context="{'group_by':'user_id'}" />
-                   <separator orientation="vertical" />
-                   <filter string="Creation" icon="terp-go-month" help="Creation Date"
-                       domain="[]" context="{'group_by':'create_date'}" />
-                   <filter string="Date" icon="terp-go-month" domain="[]"
-                       context="{'group_by':'date'}" help="Date of Call" />
-               </group>
-           </search>
-        </field>
-    </record>
-    <!-- Scheduled a phonecall search view-->
-    <record id="view_crm_case_scheduled_phonecalls_filter" model="ir.ui.view">
-        <field name="name">CRM - Scheduled Calls Search</field>
-        <field name="model">crm.phonecall</field>
-        <field name="type">search</field>
-        <field name="arch" type="xml">
-            <search string="Scheduled Phonecalls">
+               <separator/>
                <filter icon="terp-gtk-go-back-rtl" string="To Do" name="current" domain="[('state','=','open')]"/>
-
-               <separator orientation="vertical"/>
-               <field name="name"/>
+               <separator/>
+               <filter string="Unassigned Phonecalls" icon="terp-personal-" domain="[('user_id','=',False)]" help="Unassigned Phonecalls"/>
+               <separator/>
+               <filter string="Phone Calls Assigned to Me or My Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('user_id', '=', uid)]"
+                       help="Phone Calls Assigned to the current user or with a team having the current user as team leader"/>
                <field name="partner_id"/>
-               <field name="user_id">
-                   <filter string="Unassigned Phonecalls"
-                       icon="terp-personal-"
-                       domain="[('user_id','=',False)]"
-                       help="Unassigned Phonecalls" />
-               </field>
-               <field name="section_id"
-                   widget="selection" string="Sales Team">
-                   <filter string="My Sales Team(s)"
-                        icon="terp-personal+"
-                        domain="['|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
-                       help="My Sales Team(s)" />
-               <field name="date"/>
-               </field>
-               <newline/>
+               <field name="user_id"/>
+               <field name="section_id" string="Sales Team"/>
                <group expand="0" string="Group By...">
-                   <filter string="Partner" icon="terp-partner" domain="[]"
-                       context="{'group_by':'partner_id'}" />
-                   <filter string="Responsible" icon="terp-personal"
-                       domain="[]" context="{'group_by':'user_id'}" />
-                   <separator orientation="vertical" />
-                   <filter string="Creation" icon="terp-go-month" help="Creation Date"
-                       domain="[]" context="{'group_by':'create_date'}" />
-                   <filter string="Date" icon="terp-go-month" domain="[]"
-                       context="{'group_by':'date'}" help="Date of Call" />
+                   <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
+                   <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
+                   <filter string="Creation" icon="terp-go-month" help="Creation Date" domain="[]" context="{'group_by':'create_date'}"/>
+                   <filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}" help="Date of Call"/>
                </group>
            </search>
         </field>