[IMP] Improved Group by Date String
[odoo/odoo.git] / addons / crm / crm_phonecall_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5
6     <!-- Phonecall Categories Form View  -->
7     <record id="crm_phonecall_categ_action" model="ir.actions.act_window">
8         <field name="name">Phonecall Categories</field>
9         <field name="res_model">crm.case.categ</field>
10         <field name="view_type">form</field>
11         <field name="view_id" ref="crm.crm_case_categ_tree-view"/>
12         <field name="domain">[('object_id.model', '=', 'crm.phonecall')]</field>
13         <field name="context" eval="{'object_id': ref('model_crm_phonecall')}"/>
14         <field name="help" type="html">
15           <p class="oe_view_nocontent_create">
16             Click to add a new category.
17           </p><p>
18             Create specific phone call categories to better define the type of
19             calls tracked in the system.
20           </p>
21         </field>
22     </record>
23
24     <menuitem action="crm_phonecall_categ_action" name="Categories"
25         id="menu_crm_case_phonecall-act" parent="menu_crm_config_phonecall" groups="base.group_no_one"/>
26
27     <!-- Phonecalls Tree View -->
28     <record model="ir.ui.view" id="crm_case_phone_tree_view">
29         <field name="name">CRM - Phone Calls Tree</field>
30         <field name="model">crm.phonecall</field>
31         <field name="arch" type="xml">
32             <tree colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
33                 <field name="date"/>
34                 <field name="name"/>
35                 <field name="partner_id"/>
36                 <button string="Meeting"
37                     states="open,pending"
38                     name="action_make_meeting"
39                     icon="gtk-redo"
40                     type="object"/>
41                 <button string="Convert to Opportunity"
42                     type="object"
43                     name="action_button_convert2opportunity"
44                     states="open,pending"
45                     icon="gtk-index"
46                     attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
47                 <field name="partner_phone"/>
48                 <field name="user_id"/>
49                 <field name="categ_id" invisible="1"/>
50                 <field name="create_date" invisible="1"/>
51                 <field name="opportunity_id" invisible="1"/>
52                 <field name="state"/>
53                 <button name="case_open" string="Confirm" type="object"
54                         states="draft,pending" icon="gtk-go-forward"/>
55                 <button name="case_close" string="Held" type="object"
56                         states="open,pending" icon="gtk-jump-to"/>
57                 <button name="case_cancel" string="Cancel" type="object"
58                         states="draft,open,pending" icon="gtk-cancel"/>
59                 <button name="case_reset" string="Reset to Todo" type="object"
60                         states="cancel" icon="gtk-convert"/>
61             </tree>
62         </field>
63     </record>
64
65     <!-- Phonecalls Form View -->
66     <record model="ir.ui.view" id="crm_case_phone_form_view">
67         <field name="name">CRM - Phone Call Form</field>
68         <field name="model">crm.phonecall</field>
69         <field name="arch" type="xml">
70             <form string="Phone Call" version="7.0">
71                 <header>
72                     <button name="case_close" string="Call Done" type="object" class="oe_highlight"
73                             states="open,pending"/>
74                     <button name="case_reset" string="Reset to Todo" type="object"
75                             states="cancel"/>
76                     <button name="case_cancel" string="Cancel Call" type="object"
77                             states="draft,open,pending"/>
78                     <field name="state" widget="statusbar" nolabel="1" statusbar_visible="open,done"/>
79                 </header>
80                 <sheet string="Phone Call">
81                     <div class="oe_right">
82                         <button string="Convert to Opportunity"
83                             type="object"
84                             name="action_button_convert2opportunity"
85                             attrs="{'invisible':[ '|', ('opportunity_id','!=',False), ('state', 'not in', ('open', 'done'))]}"/>
86                         <button string="Schedule Other Call"
87                                 name="%(phonecall_to_phonecall_act)d"
88                                 type="action"/>
89                         <button string="Schedule a Meeting" name="action_make_meeting" type="object"/>
90                     </div>
91                     <div class="oe_title">
92                         <div class="oe_edit_only">
93                             <label for="name"/>
94                         </div>
95                         <h1><field name="name" required="1"/></h1>
96                         <div class="oe_edit_only">
97                             <label for="partner_phone" string="Phone"/>
98                         </div>
99                         <h2><field name="partner_phone"/></h2>
100                     </div>
101
102                     <group col="4">
103                         <field name="date"/>
104                         <field name="user_id"/>
105                         <field name="duration" widget="float_time"/>
106                         <field name="section_id" colspan="1" widget="selection"
107                                 groups="base.group_multi_salesteams"/>
108                         <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
109                         <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()-->
110                         <field name="categ_id" widget="selection"
111                             domain="[('object_id.model', '=', 'crm.phonecall')]"/>
112                         <field name="partner_mobile"/>
113                         <field name="priority"/>
114                         <field name="opportunity_id" on_change="on_change_opportunity(opportunity_id)"/>
115                     </group>
116                     <field name="description" placeholder="Description..."/>
117                 </sheet>
118                 <div class="oe_chatter">
119                     <field name="message_follower_ids" widget="mail_followers"/>
120                     <field name="message_ids" widget="mail_thread"/>
121                 </div>
122             </form>
123         </field>
124     </record>
125
126     <!--Logged Phonecalls Tree View -->
127     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
128         <field name="name">CRM - Logged Phone Calls Tree</field>
129         <field name="model">crm.phonecall</field>
130         <field name="arch" type="xml">
131             <tree string="Phone Calls" editable="top">
132                 <field name="date"/>
133                 <field name="name"/>
134                 <field name="partner_id"
135                     on_change="onchange_partner_id(partner_id)"/>
136                 <field name="partner_phone"
137                     invisible="1"/>
138                 <field name="user_id"/>
139                 <field name="categ_id" widget="selection"
140                     domain="[('object_id.model', '=', 'crm.phonecall')]"
141                     invisible="1"/>
142                 <field name="state" invisible="1"/>
143                 <field name="create_date" invisible="1"/>
144                 <field name="opportunity_id" invisible="1" on_change="on_change_opportunity(opportunity_id)"/>
145                 <button string="Schedule Other Call"
146                     icon="terp-call-start"
147                     name="%(phonecall_to_phonecall_act)d"
148                     type="action"/>
149                 <button string="Meeting"
150                      icon="gtk-redo"
151                      name="action_make_meeting" type="object"/>
152                 <button string="Convert to Opportunity"
153                     name="action_button_convert2opportunity"
154                     states="open,pending"
155                     icon="gtk-index"
156                     type="object" attrs="{'invisible':[('opportunity_id','!=',False)]}"/>
157             </tree>
158         </field>
159     </record>
160
161     <!-- Phonecalls Calendar View -->
162     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
163         <field name="name">CRM - Phone Calls Calendar</field>
164         <field name="model">crm.phonecall</field>
165         <field name="priority" eval="2"/>
166         <field name="arch" type="xml">
167             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
168                 <field name="name"/>
169                 <field name="partner_id"/>
170             </calendar>
171         </field>
172     </record>
173
174     <!-- Phonecalls Search View  -->
175     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
176         <field name="name">CRM - Phone Calls Search</field>
177         <field name="model">crm.phonecall</field>
178         <field name="arch" type="xml">
179             <search string="Search Phonecalls">
180                <field name="name" string="Phonecalls"/>
181                <field name="date"/>
182                <separator/>
183                <filter icon="terp-gtk-go-back-rtl" string="To Do" name="current" domain="[('state','=','open')]"/>
184                <separator/>
185                <filter string="Unassigned Phonecalls" icon="terp-personal-" domain="[('user_id','=',False)]" help="Unassigned Phonecalls"/>
186                <separator/>
187                <filter string="Phone Calls Assigned to Me or My Team(s)" icon="terp-personal+" domain="['|', ('section_id.user_id','=',uid), ('user_id', '=', uid)]"
188                        help="Phone Calls Assigned to the current user or with a team having the current user as team leader"/>
189                <field name="partner_id" filter_domain="[('partner_id','child_of',self)]"/>
190                <field name="user_id"/>
191                <field name="section_id" string="Sales Team"
192                         groups="base.group_multi_salesteams"/>
193                <group expand="0" string="Group By...">
194                    <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
195                    <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
196                    <filter string="Creation" icon="terp-go-month" help="Creation Date" domain="[]" context="{'group_by':'create_date'}"/>
197                    <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'date'}" help="Month of Call Date"/>
198                </group>
199            </search>
200         </field>
201     </record>
202
203     </data>
204 </openerp>