[MERGE] OPW 574895: fix incorrect matching of column headers when importing CSV files
[odoo/odoo.git] / addons / crm / crm_phonecall_view.xml
1 <?xml version="1.0"?>
2 <openerp>
3     <data>
4
5 <!--  Phonecall Categories Form View  -->
6
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">Create specific phone call categories to better define the type of calls tracked in the system.</field>
15     </record>
16
17     <menuitem action="crm_phonecall_categ_action" name="Categories"
18         id="menu_crm_case_phonecall-act" parent="menu_crm_config_phonecall" />
19
20 <!--  PhoneCalls Tree View -->
21
22     <record model="ir.ui.view" id="crm_case_phone_tree_view">
23         <field name="name">CRM - Phone Calls Tree</field>
24         <field name="model">crm.phonecall</field>
25         <field name="type">tree</field>
26         <field name="arch" type="xml">
27             <tree colors="gray:state in ('cancel','done');blue:state in ('pending',)" string="Phone Calls">
28                 <field name="date"/>
29                 <field name="name"/>
30                 <field name="partner_id"/>
31                 <field name="partner_contact"/>
32                 <field name="partner_phone"/>
33                 <field name="user_id"/>
34                 <field name="categ_id" invisible="1"/>
35                 <field name="create_date" invisible="1"/>
36                 <field name="opportunity_id" invisible="1"/>
37                 <button string="Convert to Opportunity"
38                     name="%(phonecall2opportunity_act)d"
39                     states="open,pending"
40                     icon="gtk-index"
41                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
42                 <button string="Meeting"
43                     states="open,pending" icon="gtk-redo"
44                      name="action_make_meeting" type="object" />
45                 <field name="state"/>
46                 <button name="case_cancel" string="Cancel" states="open,pending" type="object" icon="gtk-cancel"/>
47                 <button name="case_open" string="Todo" states="pending" type="object" icon="gtk-go-forward"/>
48                 <button name="case_close" string="Held" states="open,pending" type="object" icon="gtk-jump-to"/>
49                 <button name="case_pending" string="Not Held" states="open" type="object" icon="gtk-media-pause"/>
50             </tree>
51         </field>
52     </record>
53
54 <!-- Phonecalls Form View -->
55
56     <record model="ir.ui.view" id="crm_case_phone_form_view">
57         <field name="name">CRM - Phone Call Form</field>
58         <field name="model">crm.phonecall</field>
59         <field name="type">form</field>
60         <field name="arch" type="xml">
61             <form string="Phone Call">
62                  <group colspan="6" col="7">
63                     <field name="name" required="1"/>
64                     <field name="partner_phone"/>
65                     <field name="duration" widget="float_time"/>
66                     <button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
67
68                     <field name="date"/>
69                     <field name="user_id"/>
70                     <field name="section_id" colspan="1" widget="selection" />
71                     <button string="Schedule Other Call"
72                      icon="terp-call-start"
73                     name="%(phonecall_to_phonecall_act)d"
74                     type="action"  />
75                     <label colspan="6"  string=""/>
76                     <button string="Convert to Opportunity"
77                         name="%(phonecall2opportunity_act)d"
78                         icon="gtk-index" type="action"
79                         attrs="{'invisible':[('opportunity_id','!=',False)]}" />
80
81                 </group>
82
83                 <group col="3" colspan="2">
84                     <separator colspan="3" string="Contacts" />
85                     <field name="partner_id"
86                         on_change="onchange_partner_id(partner_id)" />
87                     <button string="Create a Partner"
88                         icon="terp-partner"
89                         name="%(action_crm_phonecall2partner)d"
90                         type="action"
91                         attrs="{'invisible':[('partner_id','!=',False)]}" 
92                         groups="base.group_partner_manager"/>
93                     <newline/>
94                     <field name="partner_address_id"
95                         on_change="onchange_partner_address_id(partner_address_id)" />
96                     <newline/>
97                     <field name="partner_mobile" />
98                 </group>
99                 <group col="2" colspan="2">
100                     <separator colspan="2" string="Categorization" />
101                     <field name="categ_id" widget="selection"
102                         domain="[('object_id.model', '=', 'crm.phonecall')]"/>
103                     <field name="priority"/>
104                     <field name="opportunity_id"/>
105                 </group>
106                 <separator string="Description" colspan="4" />
107                 <field name="description" nolabel="1" colspan="4" />
108                 <separator colspan="4" />
109                 <group col="8" colspan="4">
110                     <field name="state" widget="statusbar" statusbar_visible="open,done" statusbar_colors='{"pending":"red"}' select="1"/>
111                     <button name="case_cancel" string="Cancel"
112                         states="open,pending" type="object"
113                         icon="gtk-cancel" />
114                     <button name="case_open" string="Todo"
115                         states="pending" type="object"
116                         icon="gtk-go-forward" />
117                     <button name="case_pending" string="Not Held"
118                         states="open" type="object" icon="gtk-media-pause" />
119                     <button name="case_close" string="Held"
120                         states="open,pending" type="object"
121                         icon="gtk-jump-to" />
122                     <button name="case_reset" string="Reset to Todo"
123                         states="cancel" type="object"
124                         icon="gtk-convert" />
125                 </group>
126             </form>
127         </field>
128     </record>
129
130     <!--Logged Phonecalls Tree View -->
131
132     <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
133         <field name="name">CRM - Logged Phone Calls Tree</field>
134         <field name="model">crm.phonecall</field>
135         <field name="type">tree</field>
136         <field name="arch" type="xml">
137             <tree string="Phone Calls" editable="top">
138                 <field name="date"/>
139                 <field name="name"/>
140                 <field name="partner_id"
141                     on_change="onchange_partner_id(partner_id)"
142                     string="Partner" />
143                 <field name="partner_address_id"
144                         on_change="onchange_partner_address_id(partner_address_id)"
145                         invisible="1"/>
146                 <field name="partner_phone"
147                     invisible="1"/>
148                 <field name="user_id" groups="base.group_extended"/>
149                 <field name="categ_id" widget="selection"
150                     domain="[('object_id.model', '=', 'crm.phonecall')]"
151                     invisible="1"/>
152                 <field name="state" invisible="1"/>
153                 <field name="create_date" invisible="1"/>
154                 <field name="opportunity_id" invisible="1"/>
155                 <button string="Schedule Other Call"
156                     icon="terp-call-start"
157                     name="%(phonecall_to_phonecall_act)d"
158                     type="action"  />
159                 <button string="Meeting"
160                      icon="gtk-redo"
161                      name="action_make_meeting" type="object" />
162                 <button string="Convert to Opportunity"
163                     name="%(phonecall2opportunity_act)d"
164                     states="open,pending"
165                     icon="gtk-index"
166                     type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
167             </tree>
168         </field>
169     </record>
170
171 <!-- Phonecalls Calendar View -->
172
173     <record model="ir.ui.view" id="crm_case_phone_calendar_view">
174         <field name="name">CRM - Phone Calls Calendar</field>
175         <field name="model">crm.phonecall</field>
176         <field name="type">calendar</field>
177         <field name="priority" eval="2"/>
178         <field name="arch" type="xml">
179             <calendar string="Phone Calls" date_start="date" color="user_id" date_delay="duration">
180                 <field name="name"/>
181                 <field name="partner_id"/>
182             </calendar>
183         </field>
184     </record>
185
186 <!-- Phonecalls Search View  -->
187
188     <record id="view_crm_case_phonecalls_filter" model="ir.ui.view">
189         <field name="name">CRM - Phone Calls Search</field>
190         <field name="model">crm.phonecall</field>
191         <field name="type">search</field>
192         <field name="arch" type="xml">
193             <search string="Search Phonecalls">
194                <filter icon="terp-go-today" string="Today"
195                    domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),
196                     ('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]"
197                    name="today"
198                    help="Todays's Phonecalls"
199                />
200                <filter icon="terp-go-week"
201                    string="7 Days"
202                    help="Phonecalls during last 7 days"
203                    domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
204                />
205
206                <separator orientation="vertical"/>
207                <field name="name"/>
208                <field name="partner_id"/>
209                <field name="user_id">
210                    <filter icon="terp-personal-"
211                        domain="[('user_id','=',False)]"
212                        help="Unassigned Phonecalls" />
213                </field>
214                <field name="section_id"
215                    widget="selection" string="Sales Team">
216                    <filter icon="terp-personal+" groups="base.group_extended"
217                        domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
218                        help="My Sales Team(s)" />
219                </field>
220                <newline/>
221                <group expand="0" string="Group By...">
222                    <filter string="Partner" icon="terp-partner" domain="[]"
223                        context="{'group_by':'partner_id'}" />
224                    <filter string="Responsible" icon="terp-personal"
225                        domain="[]" context="{'group_by':'user_id'}" />
226                    <separator orientation="vertical" />
227                    <filter string="Creation" icon="terp-go-month" help="Creation Date"
228                        domain="[]" context="{'group_by':'create_date'}" />
229                    <filter string="Date" icon="terp-go-month" domain="[]"
230                        context="{'group_by':'date'}" help="Date of Call" />
231                </group>
232            </search>
233         </field>
234     </record>
235     <!-- Scheduled a phonecall search view-->
236     <record id="view_crm_case_scheduled_phonecalls_filter" model="ir.ui.view">
237         <field name="name">CRM - Scheduled Calls Search</field>
238         <field name="model">crm.phonecall</field>
239         <field name="type">search</field>
240         <field name="arch" type="xml">
241             <search string="Scheduled Phonecalls">
242                <filter icon="terp-gtk-go-back-rtl" string="To Do" name="current" domain="[('state','=','open')]"/>    
243                <separator orientation="vertical"/>
244                <filter icon="terp-go-today" string="Today"
245                    domain="[('date','&lt;', time.strftime('%%Y-%%m-%%d 23:59:59')),
246                     ('date','&gt;=',time.strftime('%%Y-%%m-%%d 00:00:00'))]"
247                    name="today"
248                    help="Todays's Phonecalls"
249                />
250                <filter icon="terp-go-week"
251                    string="7 Days"
252                    help="Phonecalls during last 7 days"
253                    domain="[('date','&gt;=',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
254                />
255
256                <separator orientation="vertical"/>
257                <field name="name"/>
258                <field name="partner_id"/>
259                <field name="user_id">
260                    <filter icon="terp-personal-"
261                        domain="[('user_id','=',False)]"
262                        help="Unassigned Phonecalls" />
263                </field>
264                <field name="section_id"
265                    widget="selection" string="Sales Team">
266                    <filter icon="terp-personal+" groups="base.group_extended"
267                        domain="['|', ('section_id', '=', context.get('section_id')), '|', ('section_id.user_id','=',uid), ('section_id.member_ids', 'in', [uid])]"
268                        help="My Sales Team(s)" />
269                </field>
270                <newline/>
271                <group expand="0" string="Group By...">
272                    <filter string="Partner" icon="terp-partner" domain="[]"
273                        context="{'group_by':'partner_id'}" />
274                    <filter string="Responsible" icon="terp-personal"
275                        domain="[]" context="{'group_by':'user_id'}" />
276                    <separator orientation="vertical" />
277                    <filter string="Creation" icon="terp-go-month" help="Creation Date"
278                        domain="[]" context="{'group_by':'create_date'}" />
279                    <filter string="Date" icon="terp-go-month" domain="[]"
280                        context="{'group_by':'date'}" help="Date of Call" />
281                </group>
282            </search>
283         </field>
284     </record>   
285
286     </data>
287 </openerp>